In my cloud formation template, I am using a few AWS-Specific Parameter Types. For example:
"VPC": {
"Description": "Choose exiting VPC",
"Type": "AWS::EC2::VPC::Id"
},
allows the user who is deploying the stack to choose from a dropdown VPC list.
I noticed that if I were to not pick a VPC and leave that parameter blank, the stack does deploy, only to fail shortly afterwards because this parameter was left empty.
I went through the documentation here: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/parameters-section-structure.html
but did not find anything which explained this behavior.
Is there any way to enforce non-empty validation for these parameters (i.e. ensure that the user does choose a value) ? I would like to ensure that an error pops up as soon as one clicks Create stack. For normal parameters, I can use AllowedPattern to enforce a certain pattern. Is there anything similar for these parameter types?
You could try and use a constraint on top of it.
Try this:
"AllowedPattern" : ".+"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With