#aws #s3
Welcome to day 6 of the unofficial AWS Cost Optimisation Advent Calendar 2024, where every day we will be sharing new tips or tricks to help you optimise your cloud costs before Christmas 2024.
No-one likes the idea of deleting data. Setting an expiry on your S3 objects or at the bucket level can help you manage your costs and ensure you are not storing data you will likely never need again.
As a best practice, you should periodically review your S3 buckets to see if any can benefit from S3 object expiry.
Some examples of buckets which typically can benefit are:
To set an expiry on your S3 objects you can use lifecycle policies which allow you to define rules for objects in your S3 bucket to automatically expire them after a certain period of time.
It also supports filters so you can apply different rules to different objects.
In addition, you can also expire objects based on size so if you have a bucket with variable size non-critical data you may decide to expire only excessively large objects.
If you have versioning enabled on your buckets then enabling expiration works slightly differently. All your old versions will be deleted however the current version will just have a delete marker making it non-current but still in the bucket. This can be useful if you need to recover the data but do not need it to be the current version. This does however also mean you are still paying for the object and this could be unexpected if you have set expiry as a cost optimisation.
Objects which are expired are permanently deleted and cannot be recovered. This is particularly important to note if you are using S3 as a backup store and have set an expiry on your backups. This does mean that special attention should be given when setting expiry on objects.
If you are managing a large amount of buckets and different object types you may benefit from using Storage Lens. This can help you monitor and report on your storage usage and costs. It is very useful for understanding your storage usage and can help you identify where you can save costs.
Just a quick one today but setting expiry on your S3 objects can be a great way to ensure you are not paying indefinitely for logs and other temporary data. It is therefore worth checking if any S3 buckets can benefit at least annually.
To be one of the first to know when the next edition is published please follow us on LinkedIn, X or subscribe to the RSS feed.
Join our newsletter for Cost Optimization tips and tricks
By subscribing you agree to our Privacy Policy and provide consent to receive updates from our company.