Monitoring and Logging

A versioned S3 bucket stores exported audit logs. Investigators must always be able to recover the three most recent prior versions of each object, but any older noncurrent version must be permanently deleted 7 days after it becomes noncurrent. Which lifecycle configuration meets these requirements?

Show the answer

Correct answerA. Noncurrent-version expiration with NoncurrentDays set to 7 and NewerNoncurrentVersions set to 3

AWhy this is right: S3 keeps the three newest noncurrent versions and permanently deletes older ones after they have been noncurrent for 7 days.

BWhy not this: Without a retained count, every noncurrent version is deleted after 7 days, including the three that must stay recoverable.

CWhy not this: Current-version expiration in a versioned bucket adds delete markers and creates more noncurrent versions; it does not remove old ones.

DWhy not this: A transition changes the storage class of older versions but keeps their data, so nothing is permanently deleted.

NewerNoncurrentVersions tells S3 how many of the newest noncurrent versions to keep; versions beyond that count are permanently deleted once they have been noncurrent for NoncurrentDays. Without the count, all noncurrent versions expire after 7 days, and a transition only moves data to another storage class.