In this video, let’s take a look at how to automatically clean obsolete objects from your s3 bucket using LifeCycle rule.
This tutorial builds on my previous two videos and in those two tutorials I show how to setup serverless Email for a custom domain using AWS services.
I used AWS SES, that’s Simple Email Service as a SMTP endpoint for your website or newsletter distribution, AWS S3 to store the incoming emails. I also setup an AWS Lambda function to forward those incoming emails stored in S3 to my gmail destination.
If we are forwarding those emails then we also need to clean up the S3 bucket of old emails otherwise they will take up storage and costs. So with Lifecycle rule you can routinely have AWS delete older objects/files automatically.
- Create a Lifecycle rule in the S3 bucket to remove old emails.
- Goto S3 bucket
- Click on Management
- Click on Create lifecycle rule
- Give a name for the Rule
- Choose scope to be All objects and acknowledge **
- For Actions select Expire, Permanently Delte and Delete expired markers
- Give 5, 5, 5 for the days.
- Click Create Rule
All videos tutorials on the website as well as the YouTube channel aim to provide a simplified process for a specific scenario; there could be many different factors and unique use cases you may have. The tutorials may not cover every situation; so treat is as a starting point or learning concept to apply to your unique situations, and consider this inspiration but not prescription or explicit direction.