Last active
February 14, 2023 20:01
-
-
Save sean-smith/f28666f384a520b644c80552fe13daf6 to your computer and use it in GitHub Desktop.
BE CAREFUL. This removes buckets with the prefix you specify.
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 | |
# Usage: bash remove-bucket.sh bucket1 | |
for bucket in $(aws s3 ls | grep $1 | awk '{ print $3}'); do | |
echo "Deleting ${bucket}..." | |
aws s3 rm --recursive s3://${bucket}; | |
aws s3 rb --force s3://${bucket}; | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment