Skip to content

Instantly share code, notes, and snippets.

@lewayotte
Last active September 25, 2020 18:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lewayotte/1b9fb8c4d32337e20441ff7df1e5c904 to your computer and use it in GitHub Desktop.
Save lewayotte/1b9fb8c4d32337e20441ff7df1e5c904 to your computer and use it in GitHub Desktop.
#!/bin/bash
/usr/local/bin/aws ec2 describe-tags --filters "Name=resource-id,Values=`wget -q -O - http://169.254.169.254/latest/meta-data/instance-id`" "Name=key,Values=domain" | grep Value | tr -d ' ' | cut -f2 -d: | tr -d '"' | tr -d ','
#/usr/local/bin/aws ec2 describe-tags --filters "Name=resource-id,Values=`wget -q -O - http://169.254.169.254/latest/meta-data/instance-id`" | grep -b1 domain | grep Value | tr -d ' ' | cut -f2 -d: | tr -d '"' | tr -d ','
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment