Skip to content

Instantly share code, notes, and snippets.

@lsegal
Created May 19, 2014 05:07
Show Gist options
  • Save lsegal/19c630e4686944bbcdee to your computer and use it in GitHub Desktop.
Save lsegal/19c630e4686944bbcdee to your computer and use it in GitHub Desktop.
var ec2east = new AWS.EC2({region: 'us-east-1'});
var ec2west = new AWS.EC2({region: 'us-west-2'});
for (some stuff) {
if (instance is master) {
ec2east.runInstances(...);
} else if (instance is a backup) {
// run in secondary AZ
ec2west.runInstances(...);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment