Skip to content

Commit 0962ab8

Browse files
authored
feat: Add cloudwatch_log_group_tags parameter for log group tags (#472)
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.
1 parent a11c970 commit 0962ab8

File tree

4 files changed

+12
-1
lines changed

4 files changed

+12
-1
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,7 @@ No modules.
283283
| <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 |
284284
| <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 |
285285
| <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 |
286+
| <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 |
286287
| <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 |
287288
| <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 |
288289
| <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 |

examples/postgresql/main.tf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,10 @@ module "aurora" {
111111
enabled_cloudwatch_logs_exports = ["postgresql"]
112112
create_cloudwatch_log_group = true
113113

114+
cloudwatch_log_group_tags = {
115+
Sensitivity = "high"
116+
}
117+
114118
create_db_cluster_activity_stream = true
115119
db_cluster_activity_stream_kms_key_id = module.kms.key_id
116120
db_cluster_activity_stream_mode = "async"

main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,7 @@ resource "aws_cloudwatch_log_group" "this" {
430430
skip_destroy = var.cloudwatch_log_group_skip_destroy
431431
log_group_class = var.cloudwatch_log_group_class
432432

433-
tags = var.tags
433+
tags = merge(var.tags, var.cloudwatch_log_group_tags)
434434
}
435435

436436
################################################################################

variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -750,6 +750,12 @@ variable "cloudwatch_log_group_class" {
750750
default = null
751751
}
752752

753+
variable "cloudwatch_log_group_tags" {
754+
description = "Additional tags for the CloudWatch log group(s)"
755+
type = map(string)
756+
default = {}
757+
}
758+
753759
################################################################################
754760
# Cluster Activity Stream
755761
################################################################################

0 commit comments

Comments
 (0)