terraform-aws-modules / terraform-aws-lambda

Terraform module, which takes care of a lot of AWS Lambda/serverless tasks (build dependencies, packages, updates, deployments) in countless combinations πŸ‡ΊπŸ‡¦
https://registry.terraform.io/modules/terraform-aws-modules/lambda/aws
Apache License 2.0
886 stars 656 forks source link

Logging_Config is not supported in Gov Cloud #539

Closed AndrewCharlesHay closed 5 months ago

AndrewCharlesHay commented 5 months ago

Description

Logging Config is declared in the module but it is not supported in the Gov Cloud Regions

If your request is for a new feature, please use the Feature request template.

⚠️ Note

Before you submit an issue, please perform the following first:

  1. Remove the local .terraform directory (! ONLY if state is stored remotely, which hopefully you are following that best practice!): rm -rf .terraform/
  2. Re-initialize the project root to pull down modules: terraform init
  3. Re-attempt your terraform plan or apply and check if the issue still persists

Versions

Reproduction Code [Required]

module "lambda" {
  source = "terraform-aws-modules/lambda/aws"
  create = var.create

  function_name  = local.name
  description    = var.description
  handler        = var.handler
  create_package = false
  publish        = true
  # Container Image
  image_uri            = local.ecr_image_uri
  package_type         = "Image"
  image_config_command = var.ecr_image_config_command
  timeout              = var.timeout
  memory_size          = var.memory_size

  # Permissions
  attach_policies = local.add_secrets || var.attach_policy
  policies        = local.add_secrets ? [aws_iam_policy.lambda_secrets_policy[0].arn, var.policy_arn] : [var.policy_arn]

  environment_variables = var.environment_variables
  event_source_mapping  = var.event_source_mapping
  allowed_triggers      = var.allowed_triggers

  vpc_subnet_ids         = var.enable_vpc ? var.vpc_subnet_ids[var.env] : null
  vpc_security_group_ids = var.enable_vpc ? [aws_security_group.lambda_security_group[0].id] : null

  attach_tracing_policy         = var.enable_xray
  tracing_mode                  = var.enable_xray ? "Active" : "PassThrough"
  logging_application_log_level = "ERROR"

  tags = merge({
    FileName = var.filename
  }, local.tags)
}

Steps to reproduce the behavior:

Run any module in Gov Cloud

Expected behavior

No error πŸ˜…

Actual behavior

β”‚ Error: updating Lambda Function (impact-api-Swagger-uat-lambda) configuration: operation error Lambda: UpdateFunctionConfiguration, https response error StatusCode: 400, RequestID: e322821a-a2e3-4486-8f46-a47f892f2c60, InvalidParameterValueException: LoggingConfig is not supported in us-gov-east-1. Remove LoggingConfig value from your request and try again

Terminal Output Screenshot(s)

Additional context

This is all mentioned in this issue on the main provider

github-actions[bot] commented 4 months ago

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.