AWS Certified Developer – Associate (DVA-C02) — Question 532
A company stores data in an Amazon S3 bucket. The data is updated multiple times every day from an application that runs on a server in the company’s on-premises data center.
The company enables S3 Versioning on the S3 bucket. After some time, the company observes multiple versions of the same objects in the S3 bucket.
The company needs the S3 bucket to keep the current version of each object and the version immediately previous to the current version.
Which solution will meet these requirements?
Answer options
- A. Configure an S3 bucket policy to retain one newer noncurrent version of the objects.
- B. Configure an S3 Lifecycle rule to retain one newer noncurrent version of the objects.
- C. Enable S3 Object Lock. Configure an S3 Object Lock policy to retain one newer noncurrent version of the objects.
- D. Suspend S3 Versioning. Modify the application code to check the number of object versions before updating the objects.
Correct answer: B
Explanation
Amazon S3 Lifecycle rules allow you to manage the lifecycle of noncurrent object versions by defining actions to transition or permanently delete them, including the ability to specify how many of the newest noncurrent versions to retain. Bucket policies (Option A) and S3 Object Lock (Option C) are used for access control and write-once-read-many (WORM) protection, respectively, and cannot manage version retention counts. Suspending S3 Versioning (Option D) is unnecessary and would add complexity to the application code instead of using native AWS features.