Skip to content

Commit

Permalink
fix: Add a way to prevent cloudwatch log group from being created (#122)
Browse files Browse the repository at this point in the history
Co-authored-by: Anton Babenko <[email protected]>
  • Loading branch information
cedric-spinergie and antonbabenko authored Nov 28, 2024
1 parent 9d906dd commit ca7a071
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ resource "aws_apigatewayv2_deployment" "this" {
################################################################################

resource "aws_cloudwatch_log_group" "this" {
for_each = { for k, v in { "this" = var.stage_access_log_settings } : k => v if local.create_stage && try(v.create_log_group, true) }
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) }

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

0 comments on commit ca7a071

Please sign in to comment.