Skip to content

Commit 020e078

Browse files
Allow slash in log group names (#26)
* Allow slash in log group names * Auto Format * Update iam.tf * Add to contributors and bump aws * Auto Format Co-authored-by: cloudpossebot <[email protected]>
1 parent 51de1bd commit 020e078

File tree

6 files changed

+31
-12
lines changed

6 files changed

+31
-12
lines changed

README.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,18 +133,19 @@ Available targets:
133133
| Name | Version |
134134
|------|---------|
135135
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.13.0 |
136-
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 2.0 |
136+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 3.0 |
137137

138138
## Providers
139139

140140
| Name | Version |
141141
|------|---------|
142-
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 2.0 |
142+
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 3.0 |
143143

144144
## Modules
145145

146146
| Name | Source | Version |
147147
|------|--------|---------|
148+
| <a name="module_log_group_label"></a> [log\_group\_label](#module\_log\_group\_label) | cloudposse/label/null | 0.25.0 |
148149
| <a name="module_role"></a> [role](#module\_role) | cloudposse/iam-role/aws | 0.13.0 |
149150
| <a name="module_this"></a> [this](#module\_this) | cloudposse/label/null | 0.25.0 |
150151

@@ -356,8 +357,8 @@ Check out [our other projects][github], [follow us on twitter][twitter], [apply
356357
### Contributors
357358

358359
<!-- markdownlint-disable -->
359-
| [![Igor Rodionov][goruha_avatar]][goruha_homepage]<br/>[Igor Rodionov][goruha_homepage] | [![Vladimir][SweetOps_avatar]][SweetOps_homepage]<br/>[Vladimir][SweetOps_homepage] | [![Hugo Samayoa][htplbc_avatar]][htplbc_homepage]<br/>[Hugo Samayoa][htplbc_homepage] | [![Yonatan Koren][korenyoni_avatar]][korenyoni_homepage]<br/>[Yonatan Koren][korenyoni_homepage] |
360-
|---|---|---|---|
360+
| [![Igor Rodionov][goruha_avatar]][goruha_homepage]<br/>[Igor Rodionov][goruha_homepage] | [![Vladimir][SweetOps_avatar]][SweetOps_homepage]<br/>[Vladimir][SweetOps_homepage] | [![Hugo Samayoa][htplbc_avatar]][htplbc_homepage]<br/>[Hugo Samayoa][htplbc_homepage] | [![Yonatan Koren][korenyoni_avatar]][korenyoni_homepage]<br/>[Yonatan Koren][korenyoni_homepage] | [![RB][nitrocode_avatar]][nitrocode_homepage]<br/>[RB][nitrocode_homepage] |
361+
|---|---|---|---|---|
361362
<!-- markdownlint-restore -->
362363

363364
[goruha_homepage]: https://github.com/goruha
@@ -368,6 +369,8 @@ Check out [our other projects][github], [follow us on twitter][twitter], [apply
368369
[htplbc_avatar]: https://img.cloudposse.com/150x150/https://github.com/htplbc.png
369370
[korenyoni_homepage]: https://github.com/korenyoni
370371
[korenyoni_avatar]: https://img.cloudposse.com/150x150/https://github.com/korenyoni.png
372+
[nitrocode_homepage]: https://github.com/nitrocode
373+
[nitrocode_avatar]: https://img.cloudposse.com/150x150/https://github.com/nitrocode.png
371374

372375
[![README Footer][readme_footer_img]][readme_footer_link]
373376
[![Beacon][beacon]][website]

README.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,3 +126,5 @@ contributors:
126126
github: "htplbc"
127127
- name: "Yonatan Koren"
128128
github: "korenyoni"
129+
- name: "RB"
130+
github: "nitrocode"

docs/terraform.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,19 @@
44
| Name | Version |
55
|------|---------|
66
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.13.0 |
7-
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 2.0 |
7+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 3.0 |
88

99
## Providers
1010

1111
| Name | Version |
1212
|------|---------|
13-
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 2.0 |
13+
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 3.0 |
1414

1515
## Modules
1616

1717
| Name | Source | Version |
1818
|------|--------|---------|
19+
| <a name="module_log_group_label"></a> [log\_group\_label](#module\_log\_group\_label) | cloudposse/label/null | 0.25.0 |
1920
| <a name="module_role"></a> [role](#module\_role) | cloudposse/iam-role/aws | 0.13.0 |
2021
| <a name="module_this"></a> [this](#module\_this) | cloudposse/label/null | 0.25.0 |
2122

iam.tf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
locals {
2-
enabled = module.this.enabled
32
iam_role_enabled = local.enabled && var.iam_role_enabled
43
}
54

main.tf

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,27 @@
1+
locals {
2+
enabled = module.this.enabled
3+
}
4+
5+
module "log_group_label" {
6+
source = "cloudposse/label/null"
7+
version = "0.25.0"
8+
9+
# Allow forward slashes
10+
regex_replace_chars = "/[^a-zA-Z0-9-\\/]/"
11+
12+
context = module.this.context
13+
}
14+
115
resource "aws_cloudwatch_log_group" "default" {
2-
count = module.this.enabled ? 1 : 0
3-
name = module.this.id
16+
count = local.enabled ? 1 : 0
17+
name = module.log_group_label.id
418
retention_in_days = var.retention_in_days
5-
tags = module.this.tags
19+
tags = module.log_group_label.tags
620
kms_key_id = var.kms_key_arn
721
}
822

923
resource "aws_cloudwatch_log_stream" "default" {
10-
count = module.this.enabled && length(var.stream_names) > 0 ? length(var.stream_names) : 0
24+
count = local.enabled && length(var.stream_names) > 0 ? length(var.stream_names) : 0
1125
name = element(var.stream_names, count.index)
1226
log_group_name = element(aws_cloudwatch_log_group.default.*.name, 0)
1327
}

versions.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ terraform {
44
required_providers {
55
aws = {
66
source = "hashicorp/aws"
7-
version = ">= 2.0"
7+
version = ">= 3.0"
88
}
99
}
1010
}

0 commit comments

Comments
 (0)