Created
April 15, 2021 15:44
-
-
Save hatchcanon/2721561633549036c8afb4701612d666 to your computer and use it in GitHub Desktop.
termination protection list generator
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 | |
for instance in $(aws ec2 describe-instances --region us-east-1 | grep InstanceId | cut -d '"' -f 4 | sort); do | |
echo -n $instance | |
aws ec2 describe-instance-attribute --instance-id $instance --attribute disableApiTermination | grep Value | cut -d : -f 2 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment