Created
April 29, 2021 00:51
-
-
Save gene1wood/6dd6da0be96d54dc2fc55b4e88e1a775 to your computer and use it in GitHub Desktop.
Command to delete all objects from S3 bucket using lifecycle configuration
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
for bucket in `cat list-of-s3-buckets.txt`; do | |
aws s3api put-bucket-lifecycle \ | |
--bucket $bucket \ | |
--lifecycle-configuration '{"Rules":[{"ID":"cleanup","Status":"Enabled","Prefix":"","Expiration":{"Days":1}}]}'; | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment