Skip to content

Instantly share code, notes, and snippets.

@gerrymiller
Created November 8, 2017 14:00
Show Gist options
  • Save gerrymiller/0173c6158f6f5f3bdc4acb835e498ed2 to your computer and use it in GitHub Desktop.
Save gerrymiller/0173c6158f6f5f3bdc4acb835e498ed2 to your computer and use it in GitHub Desktop.
List all unencrypted EBS volume attached to o2:phi=yes EC2 instances
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