Last active
December 5, 2018 20:07
-
-
Save mlabieniec/7f0bbba9a744c9c9b53741a2743e0ac7 to your computer and use it in GitHub Desktop.
This bash command will delete ALL S3 buckets that do not have versions. This will delete anything public (but also private based on your creds) but will error out on any deployment buckets (used for lambda etc.) Use at your own risk!
This file contains hidden or 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
#!/bin/bash | |
aws s3api list-buckets --query 'Buckets[*].[Name]' --output text | xargs -I {} bash -c 'aws s3 rb s3://{} --force' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment