-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Description
Describe the bug
I have an AWS CloudFormation template with the following parameter:
Profiles:
Description: The comma-separated list of active profiles, such as "dev,test".
Type: CommaDelimitedList
Default: ""
AllowedPattern: '\w+'
ConstraintDescription: Active profile identifiers must only use word characters, separated by commas.
The latest documentation for AllowedPattern
says:
When applied to a parameter of type
CommaDelimitedList
, the pattern must match each value in the list.
I try to invoke aws cloudformation deploy …
passing the Profiles
parameter:
aws cloudformation deploy … --parameter-overrides … Profiles=dev,test
This doesn't work either:
aws cloudformation deploy … --parameter-overrides … Profiles="dev,test"
In fact even this doesn't work!
aws cloudformation deploy … --parameter-overrides … Profiles=dev
The AWS CLI tells me:
An error occurred (ValidationError) when calling the CreateChangeSet operation: Parameter Profiles failed to satisfy constraint: Active profile identifiers must only use word characters, separated by commas.
If I remove AllowedPattern
, it works:
Profiles:
Description: The comma-separated list of active profiles, such as "dev,test".
Type: CommaDelimitedList
Default: ""
# AllowedPattern: '\w+'
ConstraintDescription: Active profile identifiers must only use word characters, separated by commas.
If I switch to PowerShell and try this, it fails as well:
aws cloudformation deploy … --parameter-overrides … Profiles=dev,test
This fails, too, in PowerShell:
aws cloudformation deploy … --parameter-overrides … 'Profiles=dev'
And this fails, too, in PowerShell:
aws cloudformation deploy … --parameter-overrides '… Profiles=dev'
Expected Behavior
I expected the value dev,test
to be assigned to the Profiles
parameter, exactly has happens if I remove the AllowedPattern
from the template.
Current Behavior
The CLI tells me:
`An error occurred (ValidationError) when calling the CreateChangeSet operation: Parameter Profiles failed to satisfy constraint: Active profile identifiers must only use word characters, separated by commas.
Add the following parameter to a CloudFormation template:
Parameters:
Profiles:
Description: The comma-separated list of active profiles, such as "dev,test".
Type: CommaDelimitedList
Default: ""
AllowedPattern: '\w+'
ConstraintDescription: Active profile identifiers must only use word characters, separated by commas.
Reproduction Steps
aws cloudformation deploy--stack-name foo --template-file bar.yaml --parameter-overrides Profiles=dev,test
Possible Solution
It works if I remove AllowedPattern
from the CloudFormation template.
Additional Information/Context
I have tried it with two CLI versions in three shells:
- WSL Ubunutu:
aws-cli/2.11.0 Python/3.11.2 Linux/5.15.90.1-microsoft-standard-WSL2 exe/x86_64.ubuntu.22 prompt/off
- Git Bash:
aws-cli/2.9.21 Python/3.9.11 Windows/10 exe/AMD64 prompt/off
- PowerShell:
aws-cli/2.9.21 Python/3.9.11 Windows/10 exe/AMD64 prompt/off
CLI version used
aws-cli/2.11.0 Python/3.11.2 Linux/5.15.90.1-microsoft-standard-WSL2 exe/x86_64.ubuntu.22 prompt/off
Environment details (OS name and version, etc.)
Windows 10