Skip to content

Commit

Permalink
feat: Add cloudwatch_log_group_tags parameter for log group tags (#472
Browse files Browse the repository at this point in the history
)

feat: Support `cloudwatch_log_group_tags` parameter

Similar to `security_group_tags`, sometimes it is necessary to
configure additional tags on CloudWatch log groups only.
  • Loading branch information
take-five authored Oct 15, 2024
1 parent a11c970 commit 0962ab8
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,7 @@ No modules.
| <a name="input_cloudwatch_log_group_kms_key_id"></a> [cloudwatch\_log\_group\_kms\_key\_id](#input\_cloudwatch\_log\_group\_kms\_key\_id) | The ARN of the KMS Key to use when encrypting log data | `string` | `null` | no |
| <a name="input_cloudwatch_log_group_retention_in_days"></a> [cloudwatch\_log\_group\_retention\_in\_days](#input\_cloudwatch\_log\_group\_retention\_in\_days) | The number of days to retain CloudWatch logs for the DB instance | `number` | `7` | no |
| <a name="input_cloudwatch_log_group_skip_destroy"></a> [cloudwatch\_log\_group\_skip\_destroy](#input\_cloudwatch\_log\_group\_skip\_destroy) | Set to true if you do not wish the log group (and any logs it may contain) to be deleted at destroy time, and instead just remove the log group from the Terraform state | `bool` | `null` | no |
| <a name="input_cloudwatch_log_group_tags"></a> [cloudwatch\_log\_group\_tags](#input\_cloudwatch\_log\_group\_tags) | Additional tags for the CloudWatch log group(s) | `map(string)` | `{}` | no |
| <a name="input_cluster_ca_cert_identifier"></a> [cluster\_ca\_cert\_identifier](#input\_cluster\_ca\_cert\_identifier) | The CA certificate identifier to use for the DB cluster's server certificate. Currently only supported for multi-az DB clusters | `string` | `null` | no |
| <a name="input_cluster_members"></a> [cluster\_members](#input\_cluster\_members) | List of RDS Instances that are a part of this cluster | `list(string)` | `null` | no |
| <a name="input_cluster_performance_insights_enabled"></a> [cluster\_performance\_insights\_enabled](#input\_cluster\_performance\_insights\_enabled) | Valid only for Non-Aurora Multi-AZ DB Clusters. Enables Performance Insights for the RDS Cluster | `bool` | `null` | no |
Expand Down
4 changes: 4 additions & 0 deletions examples/postgresql/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,10 @@ module "aurora" {
enabled_cloudwatch_logs_exports = ["postgresql"]
create_cloudwatch_log_group = true

cloudwatch_log_group_tags = {
Sensitivity = "high"
}

create_db_cluster_activity_stream = true
db_cluster_activity_stream_kms_key_id = module.kms.key_id
db_cluster_activity_stream_mode = "async"
Expand Down
2 changes: 1 addition & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ resource "aws_cloudwatch_log_group" "this" {
skip_destroy = var.cloudwatch_log_group_skip_destroy
log_group_class = var.cloudwatch_log_group_class

tags = var.tags
tags = merge(var.tags, var.cloudwatch_log_group_tags)
}

################################################################################
Expand Down
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -750,6 +750,12 @@ variable "cloudwatch_log_group_class" {
default = null
}

variable "cloudwatch_log_group_tags" {
description = "Additional tags for the CloudWatch log group(s)"
type = map(string)
default = {}
}

################################################################################
# Cluster Activity Stream
################################################################################
Expand Down

0 comments on commit 0962ab8

Please sign in to comment.