Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add cloudwatch_log_group_tags parameter for log group tags #472

Merged

Conversation

take-five
Copy link
Contributor

Description

Add support for configuring tags for CloudWatch log groups only via cloudwatch_log_group_tags variable.

Motivation and Context

Similar to security_group_tags, sometimes it is necessary to configure additional tags on CloudWatch log groups only. For example, in our organization we want to mark CloudWatch log groups with RDS logs as sensitive via a tag, but we don't want to apply this tag to all resources created by this module.

Breaking Changes

No

How Has This Been Tested?

  • I have updated at least one of the examples/* to demonstrate and validate my change(s)
  • I have tested and validated these changes using one or more of the provided examples/* projects

I ran terraform plan from "examples/postgresql" folder and checked that aws_cloudwatch_log_group resources include a custom tag:

  # module.aurora.aws_cloudwatch_log_group.this["postgresql"] will be created
  + resource "aws_cloudwatch_log_group" "this" {
      + arn               = (known after apply)
      + id                = (known after apply)
      + log_group_class   = (known after apply)
      + name              = "/aws/rds/cluster/ex-postgresql/postgresql"
      + name_prefix       = (known after apply)
      + retention_in_days = 7
      + skip_destroy      = false
      + tags              = {
          + "Example"     = "ex-postgresql"
          + "GithubOrg"   = "terraform-aws-modules"
          + "GithubRepo"  = "terraform-aws-rds-aurora"
          + "Sensitivity" = "high"
        }
      + tags_all          = {
          + "Example"     = "ex-postgresql"
          + "GithubOrg"   = "terraform-aws-modules"
          + "GithubRepo"  = "terraform-aws-rds-aurora"
          + "Sensitivity" = "high"
        }
    }
  • I have executed pre-commit run -a on my pull request

variables.tf Outdated
@@ -750,6 +750,12 @@ variable "cloudwatch_log_group_class" {
default = null
}

variable "cloudwatch_log_group_tags" {
description = "A mapping of tags to assign to CloudWatch log groups"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
description = "A mapping of tags to assign to CloudWatch log groups"
description = "Additional tags for the CloudWatch log group(s)"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bryantbiggs Fixed

Similar to `security_group_tags`, sometimes it is necessary to
configure additional tags on CloudWatch log groups only.
@bryantbiggs bryantbiggs changed the title feat: Support cloudwatch_log_group_tags parameter feat: Add cloudwatch_log_group_tags parameter for log group tags Oct 15, 2024
@bryantbiggs bryantbiggs merged commit 0962ab8 into terraform-aws-modules:master Oct 15, 2024
13 checks passed
antonbabenko pushed a commit that referenced this pull request Oct 15, 2024
## [9.10.0](v9.9.1...v9.10.0) (2024-10-15)

### Features

* Add `cloudwatch_log_group_tags` parameter for log group tags ([#472](#472)) ([0962ab8](0962ab8))

### Bug Fixes

* Update CI workflow versions to latest ([#471](#471)) ([a11c970](a11c970))
@antonbabenko
Copy link
Member

This PR is included in version 9.10.0 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants