Bird
0
0

Which lifecycle rule setup achieves this?

hard📝 Best Practice Q15 of 15
AWS - S3 Fundamentals
You want to save costs by moving files older than 30 days to STANDARD_IA storage and delete files older than 365 days, but only for files in the archive/ folder. Which lifecycle rule setup achieves this?
A{ "Rules": [{ "Status": "Enabled", "Prefix": "archive/", "Transition": {"Days": 365, "StorageClass": "STANDARD_IA"}, "Expiration": {"Days": 30} }] }
B{ "Rules": [{ "Status": "Enabled", "Filter": {"Prefix": "archive/"}, "Transitions": [{"Days": 30, "StorageClass": "STANDARD_IA"}], "Expiration": {"Days": 365} }] }
C{ "Rules": [{ "Status": "Enabled", "Filter": {"Prefix": "archive/"}, "Transition": {"Days": 365, "StorageClass": "STANDARD_IA"}, "Expiration": {"Days": 30} }] }
D{ "Rules": [{ "Status": "Enabled", "Filter": {"Prefix": "archive/"}, "Transitions": [{"Days": 365, "StorageClass": "STANDARD_IA"}], "Expiration": {"Days": 30} }] }
Step-by-Step Solution
Solution:
  1. Step 1: Identify correct keys for multiple transitions and expiration

    Multiple transitions require "Transitions" array. Expiration is separate. Filter with Prefix targets 'archive/'.
  2. Step 2: Check each option for correct days and storage class order

    { "Rules": [{ "Status": "Enabled", "Prefix": "archive/", "Transition": {"Days": 365, "StorageClass": "STANDARD_IA"}, "Expiration": {"Days": 30} }] } reverses days and expiration. { "Rules": [{ "Status": "Enabled", "Filter": {"Prefix": "archive/"}, "Transitions": [{"Days": 30, "StorageClass": "STANDARD_IA"}], "Expiration": {"Days": 365} }] } correctly uses "Transitions" array with 30 days to STANDARD_IA and expiration at 365 days, with filter prefix. { "Rules": [{ "Status": "Enabled", "Filter": {"Prefix": "archive/"}, "Transition": {"Days": 365, "StorageClass": "STANDARD_IA"}, "Expiration": {"Days": 30} }] } uses singular "Transition" but reverses days (365 to IA, expire 30). { "Rules": [{ "Status": "Enabled", "Filter": {"Prefix": "archive/"}, "Transitions": [{"Days": 365, "StorageClass": "STANDARD_IA"}], "Expiration": {"Days": 30} }] } reverses days and expiration.
  3. Step 3: Choose best practice with multiple transitions

    { "Rules": [{ "Status": "Enabled", "Filter": {"Prefix": "archive/"}, "Transitions": [{"Days": 30, "StorageClass": "STANDARD_IA"}], "Expiration": {"Days": 365} }] } uses "Transitions" array which is best practice for multiple transitions, even if only one here, and matches requirements.
  4. Final Answer:

    Rule with Filter prefix 'archive/', Transitions at 30 days to STANDARD_IA, Expiration at 365 days -> Option B
  5. Quick Check:

    Multiple transitions use "Transitions" array, filter prefix set = B [OK]
Quick Trick: Use "Transitions" array for multiple moves, filter prefix to target folder [OK]
Common Mistakes:
  • Confusing Transition singular vs Transitions array
  • Mixing up days for transition and expiration
  • Not using filter or prefix to limit scope

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More AWS Quizzes