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.
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.
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-configurationreturns the active rules; aNoSuchLifecycleConfigurationerror 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, withPrefix,Tag,ObjectSizeGreaterThan,ObjectSizeLessThanor anAndcombination. 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.
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-objectshowsStorageClass. When the field is absent the object is in STANDARD. - Age: compare
LastModifiedwith the rule'sDays. 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/matcheslogs/a.gzbut notLogs/a.gz. - Tags: use
aws s3api get-object-taggingif the filter includes tags; tags are not inherited from the bucket or prefix.
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.
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:
Transitionsapply to current versions only. Old versions needNoncurrentVersionTransitionswithNoncurrentDays. - Delete markers and uploads: clean up with
ExpiredObjectDeleteMarkerandAbortIncompleteMultipartUpload, 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.
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
BucketSizeBytesCloudWatch metric perStorageTypedimension to see class shifts. - Codify: manage rules with Terraform
aws_s3_bucket_lifecycle_configurationand 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.
- 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.
Senior hiring managers and bar raisers evaluate how you prioritize during outages. Avoid these common anti-patterns:
- Expecting transitions to run immediately after the rule is saved Lifecycle evaluation is asynchronous and generally daily, so give it time before changing anything.
- Forgetting noncurrent versions in a versioned bucket A <code>Transitions</code> block affects only current versions, so most stored bytes may never move.
- Using a prefix with a leading slash or wrong case Prefixes match literally, so the rule silently matches nothing.
- 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.