Skip to content

Commit

Permalink
fix: Dynamic logging config for Gov Cloud (#541)
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewCharlesHay authored Jan 31, 2024
1 parent 9e3798e commit b9a6ea1
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,17 @@ resource "aws_lambda_function" "this" {
}
}

logging_config {
log_group = var.logging_log_group
log_format = var.logging_log_format
application_log_level = var.logging_application_log_level
system_log_level = var.logging_system_log_level
dynamic "logging_config" {
# Dont create logging config on gov cloud as it is not avaible.
# See https://github.com/hashicorp/terraform-provider-aws/issues/34810
for_each = data.aws_partition.current.partition == "aws" ? [true] : []

content {
log_group = var.logging_log_group
log_format = var.logging_log_format
application_log_level = var.logging_application_log_level
system_log_level = var.logging_system_log_level
}
}

dynamic "timeouts" {
Expand Down

0 comments on commit b9a6ea1

Please sign in to comment.