Which solution will delete objects that are older than 3 years in the MOST cost-effective manner?
Configure the organization’s centralized CloudTrail trail to expire objects after 3 years.
Configure the S3 Lifecycle policy to delete previous versions as well as current versions.
Create an AWS Lambda function to enumerate and delete objects from Amazon S3 that are older than 3 years.
Configure the parent account as the owner of all objects that are delivered to the S3 bucket.
Explanations:
While configuring the CloudTrail trail to expire objects may seem beneficial, it does not directly manage the S3 bucket’s versioning and lifecycle policies. The expiration is more relevant to CloudTrail management rather than S3 object lifecycle.
Configuring the S3 Lifecycle policy to delete previous versions as well as current versions ensures that both types of objects are removed after the 3-year retention period. This method is cost-effective as it leverages S3’s built-in lifecycle management capabilities.
Creating an AWS Lambda function to delete objects is a custom solution that may involve additional costs (e.g., Lambda execution costs) and complexity. It is not as straightforward or efficient as using the built-in S3 Lifecycle policy.
Configuring the parent account as the owner of all objects may help with permissions but does not address the retention or deletion of objects older than 3 years. Ownership does not inherently manage object lifecycle or versioning.