generated from cloudposse/terraform-example-module
-
-
Notifications
You must be signed in to change notification settings - Fork 22
Closed
Labels
bug🐛 An issue with the system🐛 An issue with the system
Description
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
Labels
bug🐛 An issue with the system🐛 An issue with the system