Skip to content

Instantly share code, notes, and snippets.

@sullust
Created August 14, 2012 06:09
Show Gist options
  • Save sullust/3346810 to your computer and use it in GitHub Desktop.
Save sullust/3346810 to your computer and use it in GitHub Desktop.
EC2 Snapshots whose AMI has been deleted
echo "AMI's from snapshots which no longer exist";
echo "----------------------------------";
for i in `aws describe-snapshots | grep -o "ami-\([0-9]\|[a-z]\)\+" | sort -u`; do
if [[ -n `aws dim $i | grep requestId` ]]; then
echo "$i"; else echo "";
fi;
done;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment