diff --git a/main.tf b/main.tf index e9a35e75..1f01f2df 100644 --- a/main.tf +++ b/main.tf @@ -112,7 +112,10 @@ resource "aws_lambda_function" "this" { } } - logging_config { + 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 + count = data.aws_partition.current.partition == "aws" ? [true] : [] + log_group = var.logging_log_group log_format = var.logging_log_format application_log_level = var.logging_application_log_level