From 42ae4aa312d7bad07f9d6239674caa011302aec8 Mon Sep 17 00:00:00 2001 From: nitrocode Date: Thu, 18 Nov 2021 12:44:08 -0600 Subject: [PATCH 1/5] Allow slash in log group names --- main.tf | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/main.tf b/main.tf index ec35cbd..da3e2b4 100644 --- a/main.tf +++ b/main.tf @@ -1,13 +1,27 @@ +locals { + enabled = module.this.enabled +} + +module "log_group_label" { + source = "cloudposse/label/null" + version = "0.25.0" + + # Allow forward slashes + regex_replace_chars = "/[^a-zA-Z0-9-\\/]/" + + context = module.this.context +} + resource "aws_cloudwatch_log_group" "default" { - count = module.this.enabled ? 1 : 0 - name = module.this.id + count = local.enabled ? 1 : 0 + name = module.log_group_label.id retention_in_days = var.retention_in_days - tags = module.this.tags + tags = module.log_group_label.tags kms_key_id = var.kms_key_arn } resource "aws_cloudwatch_log_stream" "default" { - count = module.this.enabled && length(var.stream_names) > 0 ? length(var.stream_names) : 0 + count = local.enabled && length(var.stream_names) > 0 ? length(var.stream_names) : 0 name = element(var.stream_names, count.index) log_group_name = element(aws_cloudwatch_log_group.default.*.name, 0) } From 99027d02f0c111d29dc93ac69304c83431c01b8c Mon Sep 17 00:00:00 2001 From: cloudpossebot <11232728+cloudpossebot@users.noreply.github.com> Date: Thu, 18 Nov 2021 18:45:39 +0000 Subject: [PATCH 2/5] Auto Format --- README.md | 1 + docs/terraform.md | 1 + 2 files changed, 2 insertions(+) diff --git a/README.md b/README.md index daab78d..6625677 100644 --- a/README.md +++ b/README.md @@ -145,6 +145,7 @@ Available targets: | Name | Source | Version | |------|--------|---------| +| [log\_group\_label](#module\_log\_group\_label) | cloudposse/label/null | 0.25.0 | | [role](#module\_role) | cloudposse/iam-role/aws | 0.13.0 | | [this](#module\_this) | cloudposse/label/null | 0.25.0 | diff --git a/docs/terraform.md b/docs/terraform.md index 5fb9197..d032c46 100644 --- a/docs/terraform.md +++ b/docs/terraform.md @@ -16,6 +16,7 @@ | Name | Source | Version | |------|--------|---------| +| [log\_group\_label](#module\_log\_group\_label) | cloudposse/label/null | 0.25.0 | | [role](#module\_role) | cloudposse/iam-role/aws | 0.13.0 | | [this](#module\_this) | cloudposse/label/null | 0.25.0 | From 97097b4db8c4d7f01e018620e81a15548c188eb8 Mon Sep 17 00:00:00 2001 From: nitrocode Date: Thu, 18 Nov 2021 12:45:44 -0600 Subject: [PATCH 3/5] Update iam.tf --- iam.tf | 1 - 1 file changed, 1 deletion(-) diff --git a/iam.tf b/iam.tf index 0ce3248..a2ff989 100644 --- a/iam.tf +++ b/iam.tf @@ -1,5 +1,4 @@ locals { - enabled = module.this.enabled iam_role_enabled = local.enabled && var.iam_role_enabled } From 493de8ed57faace89e0591c89a729ac972bae4a7 Mon Sep 17 00:00:00 2001 From: nitrocode Date: Thu, 18 Nov 2021 12:50:22 -0600 Subject: [PATCH 4/5] Add to contributors and bump aws --- README.yaml | 2 ++ versions.tf | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/README.yaml b/README.yaml index 8c8b05e..34ed593 100644 --- a/README.yaml +++ b/README.yaml @@ -126,3 +126,5 @@ contributors: github: "htplbc" - name: "Yonatan Koren" github: "korenyoni" + - name: "RB" + github: "nitrocode" diff --git a/versions.tf b/versions.tf index 5b2c49b..85d1d00 100644 --- a/versions.tf +++ b/versions.tf @@ -4,7 +4,7 @@ terraform { required_providers { aws = { source = "hashicorp/aws" - version = ">= 2.0" + version = ">= 3.0" } } } From 2ba6927ee845828b16d59b685b908b8a8771fcf7 Mon Sep 17 00:00:00 2001 From: cloudpossebot <11232728+cloudpossebot@users.noreply.github.com> Date: Thu, 18 Nov 2021 18:51:15 +0000 Subject: [PATCH 5/5] Auto Format --- README.md | 10 ++++++---- docs/terraform.md | 4 ++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 6625677..d12a966 100644 --- a/README.md +++ b/README.md @@ -133,13 +133,13 @@ Available targets: | Name | Version | |------|---------| | [terraform](#requirement\_terraform) | >= 0.13.0 | -| [aws](#requirement\_aws) | >= 2.0 | +| [aws](#requirement\_aws) | >= 3.0 | ## Providers | Name | Version | |------|---------| -| [aws](#provider\_aws) | >= 2.0 | +| [aws](#provider\_aws) | >= 3.0 | ## Modules @@ -357,8 +357,8 @@ Check out [our other projects][github], [follow us on twitter][twitter], [apply ### Contributors -| [![Igor Rodionov][goruha_avatar]][goruha_homepage]
[Igor Rodionov][goruha_homepage] | [![Vladimir][SweetOps_avatar]][SweetOps_homepage]
[Vladimir][SweetOps_homepage] | [![Hugo Samayoa][htplbc_avatar]][htplbc_homepage]
[Hugo Samayoa][htplbc_homepage] | [![Yonatan Koren][korenyoni_avatar]][korenyoni_homepage]
[Yonatan Koren][korenyoni_homepage] | -|---|---|---|---| +| [![Igor Rodionov][goruha_avatar]][goruha_homepage]
[Igor Rodionov][goruha_homepage] | [![Vladimir][SweetOps_avatar]][SweetOps_homepage]
[Vladimir][SweetOps_homepage] | [![Hugo Samayoa][htplbc_avatar]][htplbc_homepage]
[Hugo Samayoa][htplbc_homepage] | [![Yonatan Koren][korenyoni_avatar]][korenyoni_homepage]
[Yonatan Koren][korenyoni_homepage] | [![RB][nitrocode_avatar]][nitrocode_homepage]
[RB][nitrocode_homepage] | +|---|---|---|---|---| [goruha_homepage]: https://github.com/goruha @@ -369,6 +369,8 @@ Check out [our other projects][github], [follow us on twitter][twitter], [apply [htplbc_avatar]: https://img.cloudposse.com/150x150/https://github.com/htplbc.png [korenyoni_homepage]: https://github.com/korenyoni [korenyoni_avatar]: https://img.cloudposse.com/150x150/https://github.com/korenyoni.png + [nitrocode_homepage]: https://github.com/nitrocode + [nitrocode_avatar]: https://img.cloudposse.com/150x150/https://github.com/nitrocode.png [![README Footer][readme_footer_img]][readme_footer_link] [![Beacon][beacon]][website] diff --git a/docs/terraform.md b/docs/terraform.md index d032c46..5ba635f 100644 --- a/docs/terraform.md +++ b/docs/terraform.md @@ -4,13 +4,13 @@ | Name | Version | |------|---------| | [terraform](#requirement\_terraform) | >= 0.13.0 | -| [aws](#requirement\_aws) | >= 2.0 | +| [aws](#requirement\_aws) | >= 3.0 | ## Providers | Name | Version | |------|---------| -| [aws](#provider\_aws) | >= 2.0 | +| [aws](#provider\_aws) | >= 3.0 | ## Modules