# Understanding Lifecycle rules in Amazon S3

### Introduction

To manage your objects so that they're stored cost effectively throughout their lifecycle, create an Amazon S3 Lifecycle configuration. An Amazon S3 Lifecycle configuration is a set of rules that define actions that Amazon S3 applies to a group of objects. For more information [visit](https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-lifecycle-mgmt.html).

### Steps to Create an S3 Lifecycle

1. Open the **AWS Management Console** and navigate to the **S3 dashboard**.
    
2. Click **Create bucket**.
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1722299964480/fb19aa61-1dc5-4b42-86eb-23f7ce1980f4.png?auto=compress,format&format=webp&auto=compress,format&format=webp&auto=compress,format&format=webp align="left")
    
3. Select **General purpose** bucket type.
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1722300008769/9a6f2b7a-ae48-4fe0-8d71-6bec71d585e1.png?auto=compress,format&format=webp&auto=compress,format&format=webp&auto=compress,format&format=webp align="left")
    
4. Write a bucket name, this name must be globally unique.
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1722297511455/5a02b511-e7c3-4a42-b05b-34d15614f746.png?auto=compress,format&format=webp&auto=compress,format&format=webp&auto=compress,format&format=webp align="left")
    
5. Select **ACLs enabled Object Ownership.**
    
6. Uncheck **Block all public access -&gt; Check the Acknowledgement.**
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1722302267197/d2338c6a-6027-482e-b590-291584bfe4c2.png?auto=compress,format&format=webp&auto=compress,format&format=webp align="left")
    
7. Enable **Bucket Versioning**.
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1722302343722/a08e7765-cdae-4a06-8010-486562292af1.png?auto=compress,format&format=webp&auto=compress,format&format=webp align="left")
    
8. Click **Create bucket**.
    
9. Click on **Management**.
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1722548155495/0a880881-a9f6-4426-b0ae-d5050db803c2.png?auto=compress,format&format=webp align="left")
    
10. Click on the **Create lifecycle rule.**
    
11. Write a suitable name.
    
12. Select **Apply to all the objects in the bucket** under **Choose a rule scope**.
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1722559592348/6e20fb9f-680f-4ed6-96c6-58f2870d25d2.png align="center")
    
13. Under **Lifecycle rule actions** select **Move current versions of objects between storage classes.**
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1722559617107/3306d659-34cb-4e96-a624-738317ea8bac.png align="center")
    
14. Under **Transition current versions of objects between storage classes, In Choose storage class transitions** each class has **minimum storage duration**.
    
    The **Days after object creation** should match these minimum duration periods.
    
    All the duration period with there classes will be shown in the drop down. Add the required number of transitions. Then check the acknowledgement.
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1722560537278/6efe93a6-032a-48df-b4e3-e06a295ce974.png align="center")
    
15. Click **Create rule.**
    
16. To delete the rule, select the rule -&gt; **Delete** -&gt; **Delete.**
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1722560595854/36b86436-d012-4b20-8213-fcf0e308fb02.png align="center")
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1722560631183/37e131fd-c5e9-4de5-a907-48938c5760b2.png align="center")
