Skip to content

Instantly share code, notes, and snippets.

@nathansgreen
Created November 16, 2016 15:41
Show Gist options
  • Save nathansgreen/33fc50aaa82f18a0a035b84926cd7b65 to your computer and use it in GitHub Desktop.
Save nathansgreen/33fc50aaa82f18a0a035b84926cd7b65 to your computer and use it in GitHub Desktop.
AWS ElasticBeanstalk Instance Name
#!/usr/bin/bash
export INSTANCE_ID=$(curl http://169.254.169.254/latest/meta-data/instance-id)
export INSTANCE_NAME=$( ec2-describe-instances ${INSTANCE_ID} |grep -E "^TAG.+" |cut -f 4,5 |grep -E "^Name" |cut -f 2 )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment