Skip to main content

Command Palette

Search for a command to run...

Mastering S3 Versioning & Lifecycle Rules

Published
2 min read
Mastering S3 Versioning & Lifecycle Rules
B

Cloud Specialist with hands-on experience in Microsoft Azure, now transitioning into AWS. I’m focused on building, deploying, and optimizing cloud solutions while sharing my learning journey through real-world projects and documentation.

Introduction

One thing I’m learning on my AWS journey is that data management isn’t just about storing files, it’s about controlling them.

Today’s project was all about two powerful S3 features: Versioning and Lifecycle Rules.
At first, they sounded complicated, but once I understood how they work, it all clicked, they help you save versions of your files automatically and clean up storage without manual work.


⚙️ Step 1 — Enabling Versioning

In simple terms, versioning means that every time you upload or edit a file (like demo.txt), S3 keeps all versions of it instead of replacing the old one.

Here’s how I enabled it:

  1. Opened my S3 bucket.

  2. Went to the Properties tab.

  3. Scrolled down to Bucket Versioning → clicked Edit → selected Enable.

  4. Saved changes.

Then I tested it by uploading a file called demo.txt.
After editing and re-uploading it with the same name, I noticed something cool. AWS automatically stored multiple versions of the same file.

That’s when it hit me: I’d just built data recovery into my storage.
If I ever delete or overwrite something by accident, I can restore the older version instantly.


⚙️ Step 2 — Setting Up Lifecycle Rules

Next, I explored Lifecycle Rules, which help manage file versions over time to save storage and cost.

Here’s how I did it:

  1. Opened my bucket → Management tab → clicked Create lifecycle rule.

  2. Named it something clear, like “Auto-Archive-Old-Files.”

  3. Chose Apply to all objects in the bucket.

  4. Under Actions, I selected:

    • Transition noncurrent versions to S3 Glacier after 30 days (for long-term, cheaper storage).

    • Permanently delete noncurrent versions after 90 days.

  5. Saved the rule.

Now, S3 automatically manages my old file versions, it moves them to cheaper storage or deletes them after a set time.

No manual cleanup. No extra cost. Just smart automation.


💡 Why This Is Important

Here’s what I learned:

  • Versioning protects your data — it’s like an “undo” button for files.

  • Lifecycle Rules save money — they move or delete older data automatically.

  • Together, they make your storage safer, cleaner, and cheaper.

These two features are small steps that teach a big cloud lesson, automation and resilience are the heart of AWS.


🪴 Reflection

This project made me realize how AWS helps developers and businesses worry less about mistakes and focus more on building.

Now, even if I mess up a file or forget to delete old ones, AWS has my back.

More from this blog

"

"The Cloud Computing World"

38 posts

Exploring the evolving world of cloud computing, from Azure to AWS. This is where I document my hands-on projects, lessons learned, and growth as a Cloud Specialist.