From 4c5c97b5d404a4e46945e3b6228d469743669937 Mon Sep 17 00:00:00 2001 From: BlacksmithJoe <93652830+BlacksmithJoe@users.noreply.github.com> Date: Mon, 11 Dec 2023 15:54:19 +0100 Subject: [PATCH] feat: Add tags for CloudWatch log group only (#2841) * feature: added cloudwatch log group tags input * fix: terraform docs run --- README.md | 1 + main.tf | 1 + variables.tf | 6 ++++++ 3 files changed, 8 insertions(+) diff --git a/README.md b/README.md index 465bc79878..bd15fcbae5 100644 --- a/README.md +++ b/README.md @@ -291,6 +291,7 @@ We are grateful to the community for contributing bugfixes and improvements! Ple | [aws\_auth\_users](#input\_aws\_auth\_users) | List of user maps to add to the aws-auth configmap | `list(any)` | `[]` | no | | [cloudwatch\_log\_group\_kms\_key\_id](#input\_cloudwatch\_log\_group\_kms\_key\_id) | If a KMS Key ARN is set, this key will be used to encrypt the corresponding log group. Please be sure that the KMS Key has an appropriate key policy (https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/encrypt-log-data-kms.html) | `string` | `null` | no | | [cloudwatch\_log\_group\_retention\_in\_days](#input\_cloudwatch\_log\_group\_retention\_in\_days) | Number of days to retain log events. Default retention - 90 days | `number` | `90` | no | +| [cloudwatch\_log\_group\_tags](#input\_cloudwatch\_log\_group\_tags) | A map of additional tags to add to the cloudwatch log group created | `map(string)` | `{}` | no | | [cluster\_additional\_security\_group\_ids](#input\_cluster\_additional\_security\_group\_ids) | List of additional, externally created security group IDs to attach to the cluster control plane | `list(string)` | `[]` | no | | [cluster\_addons](#input\_cluster\_addons) | Map of cluster addon configurations to enable for the cluster. Addon name can be the map keys or set with `name` | `any` | `{}` | no | | [cluster\_addons\_timeouts](#input\_cluster\_addons\_timeouts) | Create, update, and delete timeout configurations for the cluster addons | `map(string)` | `{}` | no | diff --git a/main.tf b/main.tf index 60e48ab6c4..6a25f3a63f 100644 --- a/main.tf +++ b/main.tf @@ -112,6 +112,7 @@ resource "aws_cloudwatch_log_group" "this" { tags = merge( var.tags, + var.cloudwatch_log_group_tags, { Name = "/aws/eks/${var.cluster_name}/cluster" } ) } diff --git a/variables.tf b/variables.tf index 17488000c1..810cee2bda 100644 --- a/variables.tf +++ b/variables.tf @@ -228,6 +228,12 @@ variable "cloudwatch_log_group_kms_key_id" { default = null } +variable "cloudwatch_log_group_tags" { + description = "A map of additional tags to add to the cloudwatch log group created" + type = map(string) + default = {} +} + ################################################################################ # Cluster Security Group ################################################################################