Created
February 3, 2017 23:16
-
-
Save thedoc31/9d8400421d9f7834b4e3e8336dbc2c3c to your computer and use it in GitHub Desktop.
Output BIND-friendly list of AWS servernames and EIP addresses based on name wildcard
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## be sure your AWS default profile is set up, otherwise use --profile <profilename> to point it to the right account | |
aws ec2 describe-instances --filters "Name=tag:Name,Values=<wildcard-name-query-here>" --query "Reservations[*].Instances[*].[Tags[?Key=='Name'].Value[],PublicIpAddress]" | tr -d ' ["\r\n' | sed 's/\]\]\,/\r\n/g' | sed 's/\]\,/ 300 A /g' | tr -d ']' | sort |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment