Last active
January 27, 2018 11:21
-
-
Save tsertkov/cf1438f4a07f79cee075ca52c8ec7549 to your computer and use it in GitHub Desktop.
Mass remove s3 buckets based on name pattern
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 s3 ls \ | |
| grep -e 'pr.*\.example\.com' \ | |
| cut -d ' ' -f 3 \ | |
| xargs -I {} -L 1 aws s3 rb s3://{} --force |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment