Multiple conditions in cloud formation resource creation
<p>I'm using a platform condition to control the type of environment that gets spun up on AWS. There are plenty of shared resources, but I need certain EC2 instances with pre-baked AMIs depending on a number conditions.</p>

<pre><code>"Parameters": {
"Platform": {
  "Description": "Select platform type - linux or windows",
  "Default": "linux",
  "Type": "String",
  "AllowedValues": [ "linux", "windows", "both" ],
  "ConstraintDescription": "Must enter either linux, windows, or both"
},
</code></pre>

<p>Then I set the <code>conditions</code>.</p>

<pre><code>"Conditions" : {
  "LinuxPlatform" : {"Fn::Equals" : [{"Ref" : "Platform"}, "linux"]},
  "WindowsPlatform" : {"Fn::Equals" : [{"Ref" : "Platform"}, "windows"]},
  "BothPlatform" : {"Fn::Equals" : [{"Ref" : "Platform"}, "both"]}
},
</code></pre>

<p>In a resource I'd like to use either linux or windows to trigger a Windows or Linux Ec2 creation, or use both to deploy every ec2 resource declared.</p>

<p>I've tried the following using <code>fn:or</code> in a few ways.</p>

<p><code>"Fn::Or": [{"Condition": "LinuxPlatform"}, {"Condition": "BothPlatform" }],</code></p>

<p>and...</p>

<pre><code>"Condition" : {
   "Fn::Or" : [
      {"Condition" : "LinuxPlatform"},
      {"Condition" : "BothPlatform"}
   ]
}
</code></pre>

<p>I keep getting the following error when trying to deploying and validating using the aws cli.</p>

<pre><code>aws cloudformation validate-template --template-body       file://./cloudformation/deploy.json

A client error (ValidationError) occurred when calling the ValidateTemplate operation: Template format error: Every Condition member must be a string.
</code></pre>

<p>Is it possible to evaluate multiple conditions to control resource creation? If not are there any alternatives I could try?</p>