AWS S3
Table of Contents
Deleting objects from S3 in a timely manner
How to delete objects from an S3 bucket in a timely manner?
We can use LifeCycleConfiguration to do it.
- https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-lifecycle-mgmt.html
- https://docs.aws.amazon.com/AmazonS3/latest/userguide/lifecycle-configuration-examples.html
example configuration in CloudFormation template
LifeCycleConfiguration:
Rules:
- Id: DeleteObjects
ExpirationInDays: 30
Prefix: "transit" // The name of the folder from which the files need to be deleted.
Status: Enabled
Implementation project
This project shows the following use cases.
- Generating and using presigned urls to put files on S3
- Uploading files to S3
- Zipping and Unzipping files on S3 (This happens without having to story any files on the disk)
- Picking text files from a given S3 directory