My Profile Photo
name := "Graham Beer"

`Cloud Engineer with his head in the AWS clouds, authored chapters in the PowerShell Conference Book 1 & 2 and currently learning and enjoying Go


PowerShell Conf Book Planet PowerShell Top 50 PowerShell

AWS lifecycle rules on S3 buckets with PowerShell

One of the features Amazon Simple Storage Service (S3) provides to storage buckets is lifecycle rules. You can use a lifecycle rule to remove or archive objects. I will be looking at creating a lifecycle rule with PowerShell to remove objects from a S3 bucket.

Creating a lifecycle rule is a good way to automate the housekeeping of your S3 bucket. By using lifecycle rules, you can remove objects after so many days, by a certain date, or use Amazon’s S3 Glacier for archiving. It’s worth noting that you can set lifecycle rules by bucket, prefix, or tags, and you can also set them for current and non-current (previous) versions. I will demonstrate a simple example of removing all objects by a specified date.

4sysops article continues here…