title: Running a Bash command in cloudformation
body: <p>I want to run a bash command in AWS Cloudforamtion. I find this on internet.</p>
  <pre><code> Resources:
      CommandRunner:
          Type: AWSUtility::CloudFormation::CommandRunner
          Properties: 
              Command: 'aws ssm get-parameter --name BucketName --region us-east-1 --query Parameter.Value --output text &gt; /command-output.txt'
  </code></pre>
  <p>I installed this private registry in my was account. When I use this utility, It creates a new stack and starts to deploy new resources like security groups, logs, and EC2 instance.</p>
  <p>When it comes to create EC2 instance. It gives an error:</p>
  <blockquote>
  <p><strong>Your requested instance type (t3.micro) is not supported in your requested Availability Zone (us-east-1e). Please retry your request by not specifying an Availability Zone or choosing us-east-1a, us-east-1b, us-east-1c, us-east-1d, us-east-1f. (Service: AmazonEC2; Status Code: 400; Error Code: Unsupported; Request ID: e1f9xyz; Proxy: null)</strong></p>
  </blockquote>
  <p>I followed this link:</p>
  <blockquote>
  <p>https://aws.amazon.com/premiumsupport/knowledge-center/cloudformation-commandrunner-stack/</p>
  </blockquote>
  <p>Can anyone help me with how to run a bash script in a cloud formation template?</p>