Skip to content

Instantly share code, notes, and snippets.

@zharling zharling/awscli

Last active Oct 10, 2017
Embed
What would you like to do?
AWS CLI
aws ec2 describe-instances --output text --query 'Reservations[*].Instances[*].[InstanceId, InstanceType, ImageId, State.Name, LaunchTime, Placement.AvailabilityZone, PrivateIpAddress, PrivateDnsName, [Tags[?Key==`Name`].Value] [0][0], [Tags[?Key==`DeploySide`].Value] [0][0], [Tags[?Key==`Environment`].Value] [0][0] ]'
Prod:
aws ec2 describe-instances --output text --query 'Reservations[*].Instances[*].[InstanceId, [Tags[?Key==`Name`].Value] [0][0], [Tags[?Key==`Environment`].Value] [0][0], State.Name, LaunchTime, [Tags[?Key==`DeploySide`].Value] [0][0] ]' --filters "Name=instance-state-name,Values=running" > prod_instances.csv
DR:
aws ec2 describe-instances --output text --query 'Reservations[*].Instances[*].[InstanceId, [Tags[?Key==`Name`].Value] [0][0], [Tags[?Key==`Environment`].Value] [0][0], State.Name, LaunchTime, [Tags[?Key==`DeploySide`].Value] [0][0] ]' --filters "Name=instance-state-name,Values=running" > DR_instances.csv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.