Skip to content

Instantly share code, notes, and snippets.

@robinmollah
Created June 23, 2021 07:56
Show Gist options
  • Save robinmollah/992c6d2729bcd569f83a93b1bd19ed60 to your computer and use it in GitHub Desktop.
Save robinmollah/992c6d2729bcd569f83a93b1bd19ed60 to your computer and use it in GitHub Desktop.
Searching for a region of an instance id
# Add executable permission to run it using "chmod +x aws-search-instance-id.sh"
# Example usage ./aws-search-instance-id.sh i-xxxxxxxxxx
regions="ap-southeast-2 us-west-2 us-west-1 us-east-1 us-east-2 ap-east-1 ap-southeast-1 ap-northeast-2 ap-northeast-3 ap-northeast-1 ca-central-1 eu-west-2 af-south-1 eu-central-1 eu-west-1 me-south-1 eu-south-1 eu-west-2 eu-west-3 eu-north-1 sa-east-1"
for region in $regions
do
echo "Checking: " $region
aws ec2 describe-instances --instance-ids $1 --region $region --output table
done
echo $regions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment