Closed Zeethulhu closed 1 month ago
I think this will be fixed by #329
The PR I referenced above won't fix this. It's due to YAML parsing that considers all of those values to be booleans. The aws cli fails with the same error.
aws cloudformation deploy \
--template-file test/templates/allowed-values.yaml \
--stack-name allowed \
--parameter-overrides CreateThing=No
An error occurred (ValidationError) when calling the CreateChangeSet operation:
Parameter 'CreateThing' must be one of AllowedValues
The following succeeds:
aws cloudformation deploy \
--template-file test/templates/allowed-values.yaml \
--stack-name allowed \
--parameter-overrides CreateThing=false
I'm not sure if there is a way to make a parameter that accepts the actual strings "Yes" and "No". For resource properties I added a new flag called --node-style
that will retain quotation marks around strings from the original template during formatting, but that won't work here.
When using the rain to deploy AWS CloudFormation templates that contain parameters with AllowedValues set to strings other than boolean-like values (e.g., "Yes", "No"), the tool fails with an error indicating that the parameter value must be one of the allowed values, despite the value being correctly specified. However, when the allowed values are boolean-like strings ("true", "false"), the deployment proceeds without issues.
This Cloudformation template using "true" and "false" for Allowed values deploys with no errors;
This Cloudformation template using "Yes" and "No" for Allowed values results in will return ;
"panic: error creating changeset: Parameter 'CreateThing' must be one of AllowedValues [recovered] panic: error creating changeset: Parameter 'CreateThing' must be one of AllowedValues"
Rain version
Debug Output