Skip to content

Instantly share code, notes, and snippets.

@anuragmathur1
Created February 5, 2020 23:19
Show Gist options
  • Save anuragmathur1/b7399ac5dbfe6fe43bfec52adb849c87 to your computer and use it in GitHub Desktop.
Save anuragmathur1/b7399ac5dbfe6fe43bfec52adb849c87 to your computer and use it in GitHub Desktop.
Check if the EBS volumes are encrypted on instances with a given tag
for volume in `aws ec2 describe-instances --filters Name=tag:tag-key,Values=tag-value --query 'Reservations[*].Instances[*].BlockDeviceMappings[*].Ebs.VolumeId' --output=text`
do
aws ec2 describe-volumes --volume-ids $volume --query 'Volumes[*].Encrypted' --output=text
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment