**🛠 What We’ll Do
Create an S3 Bucket

Upload Sample Objects

Set Lifecycle Policies:

Transition to different storage classes (e.g., Glacier)

Expire (delete) objects automatically

Step 1: Create an S3 Bucket
Go to the S3 Console → click Create bucket.

Give it a unique name like my-lifecycle-demo-bucket.

Choose a region (close to your users if needed).

Uncheck "Block all public access" only if necessary (for private demo, leave it checked).

Create the bucket.

✅ Done — bucket ready!

Step 2: Upload Sample Objects
Open your bucket.

Click Upload → Add files.

Upload a few sample files (text files, images, whatever you like).

Keep them organized: you can also create a folder like /test/ if you want to target specific prefixes later.

✅ Objects uploaded.

Step 3: Create a Lifecycle Rule
Now, the real magic!

In the bucket, go to the Management tab.

Scroll to Lifecycle rules → click Create lifecycle rule.

Give it a name, like MoveToGlacierThenDelete.

Choose Scope:

Apply to all objects or prefix/tag based (e.g., /test/ folder only).

Add Transition actions:

Transition to Infrequent Access (IA) after 30 days.

Transition to Glacier Instant Retrieval after 90 days.

Add Expiration actions:

Expire current versions of objects after 365 days.

(Optional) Expire previous versions if versioning is enabled.

Review → Save the rule.

✅ Lifecycle rule active!

**