Skip to content

Commit 927b714

Browse files
authored
fix: Update cloudwatch log group creation conditional (#481)
Co-authored-by: magreenbaum <magreenbaum>
1 parent 08c02ec commit 927b714

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

modules/db_instance/main.tf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,9 @@ resource "aws_db_instance" "this" {
146146
# CloudWatch Log Group
147147
################################################################################
148148

149+
# Log groups will not be created if using an identifier prefix
149150
resource "aws_cloudwatch_log_group" "this" {
150-
for_each = toset([for log in var.enabled_cloudwatch_logs_exports : log if var.create && var.create_cloudwatch_log_group])
151+
for_each = toset([for log in var.enabled_cloudwatch_logs_exports : log if var.create && var.create_cloudwatch_log_group && !var.use_identifier_prefix])
151152

152153
name = "/aws/rds/instance/${var.identifier}/${each.value}"
153154
retention_in_days = var.cloudwatch_log_group_retention_in_days

0 commit comments

Comments
 (0)