Skip to content

Instantly share code, notes, and snippets.

@prasvats
Created August 12, 2019 11:13
Show Gist options
  • Save prasvats/29eea30e0e1631227858273e9f0f4820 to your computer and use it in GitHub Desktop.
Save prasvats/29eea30e0e1631227858273e9f0f4820 to your computer and use it in GitHub Desktop.
This Script will check exposed EBS Snapshots, AMI and RDS Snapshots across all AWS region
declare -a regions=("eu-north-1" "ap-south-1" "eu-west-3" "eu-west-2" "eu-west-1" "ap-northeast-2" "ap-northeast-1" "sa-east-1" "ca-central-1" "ap-southeast-1" "ap-southeast-2" "eu-central-1" "us-east-1" "us-east-2" "us-west-1" "us-west-2")
for region in "${regions[@]}"
do
echo "+++++++++++++++++++++++++++++"
echo "Checking for Region: $region"
echo "-----------------------------"
echo "Exposed EBS Snapshots"
aws ec2 --region $region describe-snapshots --owner-id self --restorable-by-user-ids all --no-paginate --output table
echo "Exposed RDS Snapshots"
aws rds --region $region describe-db-snapshots --snapshot-type public --no-paginate --output table
echo "Exposed AMI"
aws ec2 --region $region describe-images --owners self --executable-users all --output table
echo "+++++++++++++++++++++++++++++"
echo ""
echo ""
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment