Skip to content

Commit ca7a071

Browse files
fix: Add a way to prevent cloudwatch log group from being created (#122)
Co-authored-by: Anton Babenko <[email protected]>
1 parent 9d906dd commit ca7a071

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ resource "aws_apigatewayv2_deployment" "this" {
408408
################################################################################
409409

410410
resource "aws_cloudwatch_log_group" "this" {
411-
for_each = { for k, v in { "this" = var.stage_access_log_settings } : k => v if local.create_stage && try(v.create_log_group, true) }
411+
for_each = { for k, v in { "this" = var.stage_access_log_settings } : k => v if local.create_stage && v != null && try(v.create_log_group, true) }
412412

413413
name = coalesce(each.value.log_group_name, "/aws/apigateway/${var.name}/${replace(var.stage_name, "$", "")}")
414414
retention_in_days = each.value.log_group_retention_in_days

0 commit comments

Comments
 (0)