A company stores data in an Amazon S3 bucket that is updated multiple times each day. S3 Versioning is enabled, and multiple versions of objects accumulate.
The company needs the bucket to retain only the current version and the immediately previous version of each object.
Which solution will meet these requirements?
Amazon S3 Lifecycle rules are specifically designed to manage object versions over time. When versioning is enabled, lifecycle rules can be configured to expire noncurrent versions, retaining only a defined number of recent versions.
AWS documentation states that lifecycle rules can be used to ''retain a specific number of newer noncurrent versions.'' By configuring a lifecycle rule to keep one noncurrent version, Amazon S3 automatically deletes older versions while retaining the current and immediately previous versions.
Bucket policies (Option A) control access, not retention. S3 Object Lock (Option C) is designed for regulatory compliance and write-once-read-many (WORM) use cases and is not suitable for routine version cleanup. Suspending versioning (Option D) does not remove existing versions and increases application complexity.
Therefore, an S3 Lifecycle rule is the correct and AWS-recommended solution.
Currently there are no comments in this discussion, be the first to comment!