-
-
Save ArchTaqi/51c6ed7fa0fbd5b62caab1f14ba0ad97 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