Empty with lifecycle configuration rule
From re:Post:
- Open the Amazon S3 console.
- From the list of buckets, choose the bucket that you want to empty.
- Choose the Management tab.
- Choose Create lifecycle rule.
- For Lifecycle rule name, enter a rule name.
- For Choose a rule scope, select This rule applies to all objects in the bucket.
- Select I acknowledge that this rule will apply to all objects in the bucket.
- For Lifecycle rule actions, select the following to create a lifecycle rule: a. Expire current versions of objects b. Permanently delete noncurrent versions of objects c. Delete expired object delete markers or incomplete multipart uploads
- In the Expire current versions of objects field, enter
1
in the Days after object creation field. - In the Permanently delete noncurrent versions of objects field, enter
1
in the Number of days after objects become noncurrent field. - Leave the Number of newer versions to retain field empty to delete all versions.
- Select Delete incomplete multipart uploads and enter
1
for the Number of days field. - Choose Create rule.
- Create a second lifecycle rule by repeating steps 4-7.
- Then, select the following: Delete expired delete markers or incomplete multipart uploads
- Select Delete expired object delete markers.
- Choose Create rule.