To create a bucket with an expiration lifecycle policy:
- From the navigation pane, select S3 > Buckets.
- Click Create Bucket.
- In the Name field, enter a name for your bucket. Bucket names must use only lowercase letters, numbers, periods, and hyphens.
- Click the Expiration Lifecycle policy tab.
- Click Add Rule.
- To apply the rule to all objects in a bucket, click All Objects. Alternatively, click Filter objects and search for specific objects using the Prefix field.
- Select from the following actions by clicking their associated toggle to enable them:
- Expire current version of objects: Permanently deletes an object marker after a set number of days from object creation, or on a specific date. Allows you to designate a value for expiration by selecting from either the Number of days or On the specified date fields. The default expiration period is 365 days.
- Permanently delete previous versions: Permanently deletes an object after a set number of days from having been made a previous version. Allows you to designate a length of time using the Days field. The default deletion period is 30 days.
- Delete incomplete multi-part uploads: Removes partial multi-part uploads (MPUs) uploads if they are not successfully completed within a set number of days. Allows you to designate a length of time using the Days until upload is aborted field.
- Delete expired object delete markers: Removes expired object delete marker, which are delete markers without any previous versions. This action cannot be selected if Expire current version of objects is enabled.
- When you are finished adding rules, click Save.
- When you are finished configuring your bucket, click Create.
A message confirming the creation of the new bucket is displayed and you are returned to the Buckets page.
- To view your new bucket, select it by clicking its name from the Name column or by clicking View.