Skip to content

Instantly share code, notes, and snippets.

@sanketsudake
Last active July 5, 2018 10:02
Show Gist options
  • Select an option

  • Save sanketsudake/b73ec34637bdd3c1e0961659e26b10ea to your computer and use it in GitHub Desktop.

Select an option

Save sanketsudake/b73ec34637bdd3c1e0961659e26b10ea to your computer and use it in GitHub Desktop.
List ALL AWS Instances
for region in `aws ec2 describe-regions --output text | cut -f3`
do
echo -e "Instances in region:'$region'..."
aws ec2 describe-instances --region $region --query 'Reservations[].Instances[].[State.Name,KeyName,InstanceType,Tags[].Value,PublicIpAddress]'
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment