Created
November 8, 2017 14:00
-
-
Save gerrymiller/0173c6158f6f5f3bdc4acb835e498ed2 to your computer and use it in GitHub Desktop.
List all unencrypted EBS volume attached to o2:phi=yes EC2 instances
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
aws ec2 describe-volumes --filters Name=attachment.instance-id,Values=$(aws ec2 describe-instances | jq -r '.Reservations[].Instances[] | select(any(.Tags[]; .Key == "o2:phi" and .Value == "yes")) | .InstanceId' | tr '\n' ',' | sed '$ s/,$//g') Name=encrypted,Values=false | jq '.Volumes[] | .VolumeId' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment