Skip to content

AWS partition should be parameterized #6

@bwmetcalf

Description

@bwmetcalf

Describe the Bug

The validation checks in variables.tf do not work with govcloud due to aws being hardcoded as the AWS partition name. Example,

  # Check ASM ARN format
  validation {
    condition     = var.dd_api_key_source.resource == "asm" ? can(regex("arn:aws:secretsmanager:.*:secret:.*", var.dd_api_key_source.identifier)) : true
    error_message = "ARN for AWS Secrets Manager (asm) does not appear to be valid format (example: arn:aws:secretsmanager:us-west-2:111122223333:secret:aes128-1a2b3c)."
  }

Expected Behavior

The data source aws_partition should be used to retrieve the partition name.

Steps to Reproduce

Use module in a govcloud environment and the following error will occur:

 Error: Invalid value for variable
│ 
│   on ../../../../../terraform-modules/general/monitoring/datadog/forwarder/main.tf line 42, in module "datadog_lambda_forwarder":
│   42:   dd_api_key_source               = local.dd_api_key_source
│ 
│ ARN for AWS Secrets Manager (asm) does not appear to be valid format (example: arn:aws:secretsmanager:us-west-2:111122223333:secret:aes128-1a2b3c).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug🐛 An issue with the system

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions