Skip to content

Instantly share code, notes, and snippets.

@sebsto
Created March 5, 2016 12:14
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sebsto/67a43fc7fba1ff258560 to your computer and use it in GitHub Desktop.
Save sebsto/67a43fc7fba1ff258560 to your computer and use it in GitHub Desktop.
Is your account using long EC2 IDs ?
# $ aws --version
# aws-cli/1.10.8 Python/2.7.11 Darwin/15.3.0 botocore/1.3.30
REGIONS=$(aws ec2 describe-regions --query 'Regions[].RegionName' --output text)
for R in $REGIONS ; do echo $R; aws ec2 describe-id-format --region $R --output text; done
@sebsto
Copy link
Author

sebsto commented Mar 5, 2016

And to opt-in for long ids ...

REGIONS=$(aws ec2 describe-regions --query 'Regions[].RegionName' --output text)
for R in $REGIONS 
do 
echo $R
aws ec2 modify-id-format --resource instance --use-long-ids --region $R
aws ec2 modify-id-format --resource reservation --use-long-ids --region $R
done

@jrotenstein
Copy link

And with volumes and snapshots...

REGIONS=$(aws` ec2 describe-regions --query 'Regions[].RegionName' --output text)
for R in $REGIONS 
do 
echo $R
aws ec2 modify-id-format --resource instance --use-long-ids --region $R
aws ec2 modify-id-format --resource reservation --use-long-ids --region $R
aws ec2 modify-id-format --resource snapshot --use-long-ids --region $R
aws ec2 modify-id-format --resource volume --use-long-ids --region $R
done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment