Sitemap

Member-only story

A Script To Apply A LifeCycle Rule to an S3 Bucket

Viewing storage class options and costs…kind of…and selecting the best one.

7 min readSep 2, 2025

--

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

⚙️A series on Security Automation. The Code.

🔒 Related Stories: AWS Security | Cloud Security | AI

💻 Free Content on Jobs in Cybersecurity | ✉️ Sign up for the Email List

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

In the last post I was trying out how to display the information to make an intelligent configuration choice when running this script. I’m not going to say this is perfect. Note caveats below. The code:

Here’s the new addition to my archive script to allow adding the S3 lifecycle rule to a bucket. You now have three options when running the script:

Press enter or click to view image in full size

Choose a profile, a region, and select from a list of buckets:

--

--

Teri Radichel
Teri Radichel

Written by Teri Radichel

CEO 2nd Sight Lab | Pentesting | Research | AWS Security Hero | Masters of Infosec & Masters Software Engineering | GSE | IANS | SANS Difference Makers Award