Skip to content

Instantly share code, notes, and snippets.

@ninjascribble
Created November 13, 2013 20:51
Show Gist options
  • Save ninjascribble/7456178 to your computer and use it in GitHub Desktop.
Save ninjascribble/7456178 to your computer and use it in GitHub Desktop.
ec2.describeInstances(params, handleResponse);
function handleResponse(err, data){
if (err) {
console.log("Error", err);
return;
}
else {
var status = data.Reservations[0].Instances[0].State;
console.log("Status: ", status);
if (status != 'running') {
ec2.describeInstances(params, handleResponse);
}
else {
// hooray! do something else now
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment