⚡ ~/naveed Interview Prep
⚡ Portfolio Home 👤 About Naveed Bio & Credentials 📫 Contact Naveed Get In Touch ✍️ Engineering Blog Deep Dives 🎯 Interview Hub 1,000+ Scenarios ☸️ Kubernetes Mastery Hub 24 Modules 🎮 DevOps Arcade & Quizzes Subnet Blitz ⚡ 🗺️ DevOps Roadmaps PDFs & Guides 🤖 Morpheus Analysis AI Quant ↗ 🛠️ Developer Tools Utilities 🧪 Labs & Experiments 📄 Interactive CV & Certs 🔗 All Links & Socials ⚡ Join The Dispatch (Weekly SRE Newsletter) →
← Back to All AWS & Cloud Architecture Interview Questions Scenario 53 of 179 in AWS & Cloud Architecture
Senior DevOps / SRE [L2] AWS Cost & Architecture Production Scenario [L2]
🎯 Target Role / Context: AWS Scenario #51 (L2) · Cost & Architecture

Q: An S3 lifecycle rule is not transitioning objects as expected.

Objects must be > 128KB for lifecycle transition to Glacier to apply. Also check the prefix filter matches your objects.

#AWS #Cost & Architecture #L2 #Cloud #Infrastructure #S3
🎙️ Candidate Opening & Architectural Context
"When an <strong>S3 lifecycle rule is not transitioning objects</strong>, the cause is almost always a mismatched filter, a minimum-age or minimum-size constraint, version handling, or simply that rules run asynchronously. Work from the configuration to the object: confirm the rule is enabled and matches, check each object's age, size and storage class, then allow for processing delay. Interviewers use this as a diagnostic question to see whether you follow a methodical runbook with real CLI evidence instead of guessing."
Advertisement
⚡ Recommended Practice Lab

Want to master this scenario in a live sandbox? Stephane Maarek's AWS Certified DevOps Engineer Professional Masterclass on Udemy covers this exact problem with hands-on terminal drills.

🛠️ Production Runbook & Step-by-Step Resolution

Direct Answer: When an <strong>S3 lifecycle rule is not transitioning objects</strong>, the cause is almost always a mismatched filter, a minimum-age or minimum-size constraint, version handling, or simply that rules run asynchronously. Work from the configuration to the object: confirm the rule is enabled and matches, check each object's age, size and storage class, then allow for processing delay. Interviewers use this as a diagnostic question to see whether you follow a methodical runbook with real CLI evidence instead of guessing.

1️⃣

Symptom and first check: read the live lifecycle configuration

Start from what S3 actually has, not what Terraform or the console says you intended.

aws s3api get-bucket-lifecycle-configuration --bucket my-bucket

# Typical rule under review
# {
#   "ID": "to-ia",
#   "Status": "Enabled",
#   "Filter": {"Prefix": "logs/"},
#   "Transitions": [{"Days": 30, "StorageClass": "STANDARD_IA"}]
# }
  • Fetch the rule: aws s3api get-bucket-lifecycle-configuration returns the active rules; a NoSuchLifecycleConfiguration error means no rules exist at all.
  • Status: confirm each rule has "Status": "Enabled". A disabled rule is common after a console experiment or Terraform drift.
  • Filter shape: inspect Filter, with Prefix, Tag, ObjectSizeGreaterThan, ObjectSizeLessThan or an And combination. Several conditions combine with AND, so one unmatched tag excludes the object.
  • Rule overlap: multiple rules can match one object. Review them together, because conflicting actions are resolved by S3 rules and may not do what you expect.
2️⃣

Hands-on: S3 lifecycle rule not transitioning, check the objects

Pick a specific object that should have moved and prove why it did not.

aws s3api head-object --bucket my-bucket --key logs/2025/app.gz
# look at: LastModified, StorageClass, ContentLength, Expiration

aws s3api list-objects-v2 --bucket my-bucket --prefix logs/ \
  --query 'Contents[?StorageClass==`STANDARD`].[Key,Size,LastModified]' \
  --output table --max-items 20

aws s3api get-object-tagging --bucket my-bucket --key logs/2025/app.gz
  • Storage class: aws s3api head-object shows StorageClass. When the field is absent the object is in STANDARD.
  • Age: compare LastModified with the rule's Days. Age is counted from object creation, and the action is scheduled for midnight UTC after the threshold is met.
  • Prefix mismatch: prefixes are literal and case-sensitive, and should not start with a slash. logs/ matches logs/a.gz but not Logs/a.gz.
  • Tags: use aws s3api get-object-tagging if the filter includes tags; tags are not inherited from the bucket or prefix.
Advertisement
3️⃣

Constraints that silently block transitions

S3 enforces transition rules that are easy to miss, and some depend on current service behaviour.

  • Minimum object size: transitions to cost-saving classes have a minimum object size, because small objects can cost more in colder tiers. By default this is around 128 KB, and you can override the default with the lifecycle configuration's transition default minimum object size setting. Check current S3 documentation.
  • Minimum days: some classes require objects to remain in the source class for a minimum period (for example 30 days before Standard-IA or One Zone-IA). A rule with fewer days is rejected or ineffective.
  • Transition order: transitions only move downward through the storage class waterfall. You cannot lifecycle an object from Glacier back to Standard.
  • Timing: rules are evaluated asynchronously, roughly daily. Allow a day or two after the rule is created or the age threshold passes before declaring failure.
  • Class-specific rules: some target classes, such as Glacier Deep Archive, have their own minimum storage durations and retrieval characteristics that affect billing even if the transition itself works. Review the S3 storage class documentation for the class you target.
Pro Tip: Newly added or edited rules may take time to take effect, and the time to first run is not instant. Do not delete and recreate rules repeatedly while waiting; that resets nothing and creates noise.
4️⃣

Versioned buckets, locks and other edge cases

Many production buckets are versioned, which changes what a rule applies to.

{
  "Rules": [{
    "ID": "tier-and-clean",
    "Status": "Enabled",
    "Filter": {"Prefix": "logs/"},
    "Transitions": [{"Days": 30, "StorageClass": "STANDARD_IA"}],
    "NoncurrentVersionTransitions": [{"NoncurrentDays": 30, "StorageClass": "GLACIER"}],
    "AbortIncompleteMultipartUpload": {"DaysAfterInitiation": 7}
  }]
}
  • Current versus noncurrent: Transitions apply to current versions only. Old versions need NoncurrentVersionTransitions with NoncurrentDays.
  • Delete markers and uploads: clean up with ExpiredObjectDeleteMarker and AbortIncompleteMultipartUpload, since they otherwise accumulate cost without matching transition rules.
  • Object Lock: retention and legal hold block deletion, so they prevent expiration actions. They do not generally block storage class transitions.
  • Replicated objects and Intelligent-Tiering: objects already in Intelligent-Tiering move between tiers automatically; a transition rule is unnecessary and may confuse your audit.
5️⃣

Fix, verify and prevent

Apply the fix, then confirm with data rather than waiting and hoping.

  • Apply: aws s3api put-bucket-lifecycle-configuration --bucket my-bucket --lifecycle-configuration file://lifecycle.json. This replaces the entire configuration, so include every rule.
  • Verify at scale: enable S3 Inventory (storage class field) or use S3 Storage Lens to chart storage by class instead of sampling objects.
  • Alert: track the BucketSizeBytes CloudWatch metric per StorageType dimension to see class shifts.
  • Codify: manage rules with Terraform aws_s3_bucket_lifecycle_configuration and run a plan in CI to catch drift; include a test object in a dev bucket with a short rule to prove the setup.
  • Cost angle: transition requests are billed per object, so transitioning millions of tiny objects can cost more than it saves; combine small files before archiving where possible.
💡 The Senior SRE Gold Nugget (Key Architectural Takeaway)
"Pro-Tip: Always inspect one concrete object with <code>head-object</code> against the live rule from <code>get-bucket-lifecycle-configuration</code>, and remember that <code>put-bucket-lifecycle-configuration</code> replaces all rules at once."
⚡ 60-Second Elevator Pitch Talking Points
  • I start with <code>get-bucket-lifecycle-configuration</code> to confirm the rule is enabled and its filter matches the prefix, tags and size.
  • Then I check a sample object with <code>head-object</code> for age, size and storage class, and account for minimum size, minimum days and the roughly daily asynchronous run.
  • For versioned buckets I add noncurrent-version rules, and I verify bucket-wide with S3 Inventory or Storage Lens rather than spot checks.
⛔ Critical Candidate Mistakes to Avoid in This Scenario

Senior hiring managers and bar raisers evaluate how you prioritize during outages. Avoid these common anti-patterns:

  1. Expecting transitions to run immediately after the rule is saved Lifecycle evaluation is asynchronous and generally daily, so give it time before changing anything.
  2. Forgetting noncurrent versions in a versioned bucket A <code>Transitions</code> block affects only current versions, so most stored bytes may never move.
  3. Using a prefix with a leading slash or wrong case Prefixes match literally, so the rule silently matches nothing.
  4. Calling <code>put-bucket-lifecycle-configuration</code> with only the new rule It overwrites all existing rules, which can remove expiration or cleanup rules unintentionally.
Advertisement
Want more AWS & Cloud Architecture scenarios?
Explore our complete collection of scenario-based AWS & Cloud Architecture interview runbooks.
Browse All AWS & Cloud Architecture Questions →