A hospital keeps application audit logs in an S3 bucket with versioning turned on. Clinicians rarely read logs after 30 days, but the compliance policy requires that logs be kept for seven years and then deleted.
Engineers sometimes re-upload corrected log files, which creates noncurrent versions. Finance wants storage costs kept low, and noncurrent copies must be deleted 30 days after they stop being current. Incomplete multipart uploads should not accumulate either.
Which lifecycle configuration meets these requirements with the LEAST operational overhead?
Choose one answer.
AA. Create a lifecycle rule that moves current objects to S3 Glacier Flexible Retrieval after 30 days and never expires them. Keep noncurrent versions in the same storage class for as long as the bucket exists.
BB. Transition current objects to Glacier Flexible Retrieval at 30 days and expire them at 2,555 days. Expire noncurrent versions 30 days after they become noncurrent, and abort incomplete uploads after seven days.
CC. Create a rule that expires current objects after 2,555 days, and leave noncurrent versions alone so engineers can restore older logs at any time. Upload new logs in the Standard-IA storage class to reduce costs.
DD. Keep the lifecycle rules as they are, and run a scheduled Lambda function each month that lists the bucket and deletes logs older than seven years along with noncurrent versions older than 30 days.
Show the answer and explanation
Answer: B
A. Wrong: Objects are archived at a lower cost, but nothing is deleted after seven years, which breaks the deletion rule. Noncurrent versions also stay indefinitely, so costs keep growing and the 30-day requirement is missed.
B. Right: Correct. The transition lowers storage costs, the expiration deletes logs after seven years, and the noncurrent rule removes replaced versions on schedule. The multipart rule stops abandoned uploads from piling up, all without custom code. Learn more: Managing your storage lifecycle (opens in a new tab)
C. Wrong: Expiring current objects deletes logs on schedule, but noncurrent versions remain and keep costing money. Standard-IA lowers the price per gigabyte only a little for rarely read data, and it does not move logs into an archive class.
D. Wrong: The function would work, but the team must write, test, and run it indefinitely. A bucket lifecycle configuration does the same job with no code, so this option adds overhead the team does not need.
Explanation
S3 lifecycle rules can transition objects to cheaper classes, expire current and noncurrent versions on set schedules, and abort incomplete multipart uploads. One set of rules covers the retention, cost, and cleanup requirements without custom code. The other options keep logs forever, skip noncurrent versions, or add a scheduled function.
Want more on Data retention and lifecycle (S3 Lifecycle, EFS lifecycle, FSx backups)? The 5 full-length practice sets have 6 more Data retention and lifecycle (S3 Lifecycle, EFS lifecycle, FSx backups) questions, 325 in all, none of them in the free exam. One payment of $14.99, no subscription. See the practice sets →