File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -88,6 +88,26 @@ aws_s3_rm_instruction() {
8888 aws_s3_ls
8989 ]
9090 "
91+
92+ # https://stackoverflow.com/questions/29809105/how-do-i-delete-a-versioned-bucket-in-aws-s3-using-the-cli
93+ # TODO Later (Verify later)
94+ cat << -__EOF__
95+
96+ # Delete all object versioning enabled
97+ aws s3api put-bucket-lifecycle-configuration \
98+ --lifecycle-configuration '{"Rules":[{
99+ "ID":"empty-bucket",
100+ "Status":"Enabled",
101+ "Prefix":"",
102+ "Expiration":{"Days":1},
103+ "NoncurrentVersionExpiration":{"NoncurrentDays":1}
104+ }]}' \
105+ --bucket ${aws_s3_bucket_name}
106+
107+ # Then you just have to wait 1 day and the bucket can be deleted with
108+ aws s3api delete-bucket --bucket ${aws_s3_bucket_name}
109+
110+ __EOF__
91111}
92112
93113aws_s3_rm_with_hint () {
You can’t perform that action at this time.
0 commit comments