title: How to poll AWS CLI in shell script?
body: <p>As part of my CD pipeline in snap-ci.com, I want to start the instances in my AWS opsworks stack before deploying the application. </p>
  
  <p>As starting hosts takes a certain amount of time (after the command has already returned), I need to poll for the instances to be running (using the describe-instances command in AWS CLI). This command does return a full JSON response of which one of the fields contains the status of the instance (e.g. "running").</p>
  
  <p>I am new to shell scripting and AWS CLI and would appreciate some pointers. I am aware that I can also use the AWS SDK's to program it in java, but that would require to deploy that program to the snap-ci hosts first which sounds complex as well.</p>