Skip to content

Instantly share code, notes, and snippets.

@sustacek
Last active October 27, 2020 15:40
Show Gist options
  • Save sustacek/987a85e51387849d7debe676ed7d19ff to your computer and use it in GitHub Desktop.
Save sustacek/987a85e51387849d7debe676ed7d19ff to your computer and use it in GitHub Desktop.
The snippet of a Cloud Formation template, which supports input of boolean parameter and using it for a resource with Boolean property.
{
...
"Parameters": {
"DbRdsMultiAZ": {
"Type": "String",
"Description": "Specifies if the RDS instance is deployed in multiple Availability Zones.",
"AllowedValues": [
"yes",
"no"
],
"Default": "no"
}
},
"Conditions" : {
"DbRdsMultiAZCondition" : {"Fn::Equals" : [{"Ref" : "DbRdsMultiAZ"}, "yes"]}
},
"Resources": {
"DbRdsLiferayInstance": {
"Type": "AWS::RDS::DBInstance",
"Properties": {
...
"MultiAZ": { "Fn::If" : [
"DbRdsMultiAZCondition",
true,
false
]}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment