Which solution will reduce the S3 costs with the LEAST operational overhead?
Use S3 Lifecycle to delete expired object versions and retain the two most recent versions.
Use an AWS Lambda function to check for older versions and delete all but the two most recent versions.
Use S3 Batch Operations to delete noncurrent object versions and retain only the two most recent versions.
Deactivate versioning on the S3 bucket and retain the two most recent versions.
Explanations:
Using S3 Lifecycle policies to delete expired object versions allows the company to automatically manage the retention of object versions with minimal operational overhead. It can be configured to retain only the two most recent versions, which aligns with the requirement to reduce costs while minimizing application changes.
While an AWS Lambda function could achieve the goal of retaining only the two most recent versions, it introduces more operational overhead. It requires custom code and monitoring, as well as setup and maintenance of the Lambda function. This approach is less efficient than using S3 Lifecycle policies.
S3 Batch Operations could technically be used to delete noncurrent object versions, but it requires manual setup and operation for each execution. This method is not automated, leading to increased operational overhead compared to a lifecycle policy, which can handle deletions automatically.
Deactivating versioning would eliminate the ability to store multiple versions of the objects, which contradicts the requirement to retain the two most recent versions. This would not solve the problem and may lead to loss of data.