Last active
November 6, 2020 14:33
-
-
Save nirbhabbarat/73a87764326a0765f94a9eae56a5ad76 to your computer and use it in GitHub Desktop.
ec2-export.sh
This file contains hidden or 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
# export AWS_PROFILE=prod | |
for region in `aws ec2 describe-regions --output text | cut -f4` | |
do | |
echo -e "\nListing Instances in region:'$region'..." | |
aws ec2 describe-instances --region $region --output text --query 'Reservations[*].Instances[*].[InstanceId, InstanceType, State.Name, Placement.AvailabilityZone, PrivateIpAddress, PublicIpAddress, InstanceLifecycle, Platform, [Tags[?Key==`Name`].Value] [0][0] ]' >> ec2-instances.tsv | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment