Last active
February 20, 2017 11:35
-
-
Save enisozgen/204bf95270311699038c98e3fc51393c to your computer and use it in GitHub Desktop.
Show all EBS volumes size by filtering any environment
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
# Shows all volumes of any environment | |
REGION='us-east-1' | |
VOLUMES=$(aws ec2 describe-instances --region=$REGION --query 'Reservations[*].Instances[*].BlockDeviceMappings[*].Ebs' --filter "Name=tag:Environment,Values=Uat" --output text | awk '{print($4)}') | |
echo "Your volumes $VOLUMES" | |
for VOLUME in $VOLUMES | |
do | |
aws ec2 describe-volumes --region $REGION --volume-ids $VOLUME --query 'Volumes[*].Size' --output text | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
First you have to write .boto your credentials