Which solution will meet this requirement with the LEAST development effort?
Update the application code. In the code, add a rule to scan all the objects in the S3 bucket every day and to delete objects after 90 days.
Create an AWS Lambda function. Program the Lambda function to scan all the objects in the S3 bucket every day and to delete objects after 90 days.
Create an S3 Lifecycle rule for the S3 bucket to expire objects after 90 days.
Partition the S3 objects with a//key prefix. Create an AWS Lambda function to remove objects that have prefixes that have reached the expiration date.
Explanations:
Updating the application code to handle the deletion of old PDFs requires significant development effort, as it necessitates modifying the existing application and managing the deletion logic within the codebase.
While creating an AWS Lambda function to delete objects is a valid solution, it involves additional development effort to write, deploy, and manage the Lambda function to scan the S3 bucket daily. This is more complex than necessary for the requirement.
Creating an S3 Lifecycle rule is the simplest and most efficient method to automatically expire and delete objects older than 90 days without additional coding or maintenance. It leverages built-in S3 functionality, ensuring minimal development effort.
Partitioning the S3 objects and creating a Lambda function to manage deletions introduces unnecessary complexity. It requires both the creation of prefixes and additional development for the Lambda function, which is more effort than needed to meet the requirement.