How do I delete a versioned bucket in AWS S3 using the CLI?

前端 未结 20 935
我在风中等你
我在风中等你 2020-12-07 16:34

I have tried both s3cmd:

$ s3cmd -r -f -v del s3://my-versioned-bucket/

And the AWS CLI:

$ aws s3 rm s3://my-v         


        
20条回答
  •  时光取名叫无心
    2020-12-07 17:07

    You can do this from the AWS Console using Lifecycle Rules.

    Open the bucket in question. Click the Management tab at the top. Make sure the Lifecycle Sub Tab is selected. Click + Add lifecycle rule

    On Step 1 (Name and scope) enter a rule name (e.g. removeall) Click Next to Step 2 (Transitions) Leave this as is and click Next.

    You are now on the 3. Expiration step. Check the checkboxes for both Current Version and Previous Versions. Click the checkbox for "Expire current version of object" and enter the number 1 for "After _____ days from object creation Click the checkbox for "Permanently delete previous versions" and enter the number 1 for "After _____ days from becoming a previous version"

    click the checkbox for "Clean up incomplete multipart uploads" and enter the number 1 for "After ____ days from start of upload" Click Next Review what you just did.
    Click Save

    Come back in a day and see how it is doing.

提交回复
热议问题