Skip to content

Instantly share code, notes, and snippets.

@thibault-ketterer
Created January 18, 2024 18:52
Show Gist options
  • Save thibault-ketterer/7bda669cd1c2e15681784f5bd23bad3c to your computer and use it in GitHub Desktop.
Save thibault-ketterer/7bda669cd1c2e15681784f5bd23bad3c to your computer and use it in GitHub Desktop.
# list ec2 instances everywhere, with creation date and tag,
# output is not really nice beacuse of tags, but it works
for region in $(aws ec2 describe-regions --query "Regions[].RegionName" --output text); do
echo "Region: $region"
aws ec2 describe-instances --region $region --query 'Reservations[].Instances[].[InstanceId, InstanceType, LaunchTime, State.Name, Tags]' --output text
echo
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment