Last active
April 29, 2016 03:28
-
-
Save ranrotx/9b2839b9a3b2dbc04bc8 to your computer and use it in GitHub Desktop.
Enable long instance, reservation, snapshot, and volume IDs across all AWS regions.
This file contains 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
#!/bin/bash | |
REGIONS=`aws ec2 describe-regions --region us-east-1 --output text | awk '{print $3}'` | |
for r in $REGIONS; do | |
echo "Enabling long IDs for instnaces and reservations in $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 |
Added in snapshot and volume as a resource type.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
From AWS console: These changes apply to the entire account UNLESS you are logged in as an IAM user. If you are logged in as an IAM user, these settings will only apply to that user. If you are logged in as an IAM role or as the root user, these changes will apply across the account.
Based on the above, if you want this change to take effect across your entire account, you may need to run from an EC2 instance using an IAM role or using access keys/secret keys from the root user (not recommended).