Skip to content

Instantly share code, notes, and snippets.

@elblivion
Last active February 14, 2016 07:49
Show Gist options
  • Save elblivion/eb714b33549f002da05b to your computer and use it in GitHub Desktop.
Save elblivion/eb714b33549f002da05b to your computer and use it in GitHub Desktop.
#!/bin/bash
AZ=`ec2metadata | grep ^availability-zone | cut -f 2 -d" "`
REGION=`ec2metadata | grep ^availability-zone | cut -f 2 -d" " | sed 's/.$//'`
INSTANCE=`ec2metadata | grep ^instance-id | cut -f 2 -d" "`
trap "echo \"New instance $INSTANCE failed setup\" | \
/usr/local/bin/gofog sns publish -r ${sns_region} -t ${sns_topic} \
-s \"New instance $INSTANCE failed setup\"" ERR
set -e
# do stuff
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment