How to Configure S3 Lifecycle Rules for Cost Optimization
Overview
This tutorial guides you through adding S3 lifecycle rules to a bucket that exceeds 100GB but has no lifecycle policy configured. Without lifecycle rules, all objects remain in S3 Standard storage indefinitely, regardless of how frequently they're accessed.
By configuring lifecycle transitions, you can automatically move aging objects to cheaper storage classes like Intelligent-Tiering and Glacier Flexible Retrieval, significantly reducing storage costs.
What You'll Configure
- Intelligent-Tiering (after 30 days): Automatically optimizes costs based on access patterns — up to 68% savings for infrequently accessed data
- Glacier Flexible Retrieval (after 90 days): Archival storage at
75% less than S3 Standard ($0.0036/GB vs ~$0.023/GB)
Prerequisites
- AWS account with S3 permissions
- Access to the AWS Console
- An S3 bucket with no lifecycle policy configured
Step-by-Step Instructions
Step 1: Navigate to Your S3 Bucket
- Log in to the AWS Console
- Navigate to S3 > Buckets and select the bucket flagged for having no lifecycle policy
- Ensure you're in the correct region (check the region selector in the top-right)
This bucket has been flagged because it exceeds 100GB in size but has no lifecycle policy configured, meaning all objects remain in S3 Standard storage indefinitely.
Step 2: Open Lifecycle Configuration
Click the Management tab to access lifecycle rule settings.
Step 3: Create a New Lifecycle Rule
Click Create lifecycle rule to begin configuring a new lifecycle policy. This is where you'll define rules for automatically transitioning or expiring objects.
Step 4: Configure Rule Name and Scope
Enter a descriptive name for the lifecycle rule:
- Type
transition-to-cheaper-storagein the Lifecycle rule name field - Select Apply to all objects in the bucket to ensure all current and future objects are covered by this rule
- Check the acknowledgment box confirming the rule applies to all objects
Step 5: Choose Lifecycle Rule Actions
Under Lifecycle rule actions, check Move current versions of objects between storage classes. This enables automatic transitions from S3 Standard to cheaper tiers as objects age.
Step 6: Configure Storage Class Transitions
Set up two transitions to progressively move objects to cheaper storage:
First transition — Intelligent-Tiering:
- Select Intelligent-Tiering from the storage class dropdown
- Enter
30for Days after object creation
Objects older than 30 days will transition to Intelligent-Tiering, which automatically optimizes costs based on access patterns.
Second transition — Glacier Flexible Retrieval:
- Click Add transition to add a second rule
- Select Glacier Flexible Retrieval from the storage class dropdown
- Enter
90for Days after object creation
Objects older than 90 days will transition to Glacier Flexible Retrieval for very low-cost archival storage.
Your transitions should now show:
| Transition | Storage Class | Days After Object Creation |
|---|---|---|
| 1 | Intelligent-Tiering | 30 |
| 2 | Glacier Flexible Retrieval | 90 |
Step 7: Create the Rule
Review your configuration and click Create rule. The lifecycle rule will begin evaluating objects within 24-48 hours.
Step 8: Verify the Lifecycle Rule
You should see a success banner confirming the rule was created. The Management tab now shows your lifecycle rule transition-to-cheaper-storage with status Enabled.
The rule will automatically begin transitioning objects based on the configured schedule. No further action is required — S3 handles transitions in the background.
Cost Savings Example
For a 100 GB bucket:
- S3 Standard: ~$2.30/month
- After Intelligent-Tiering (30+ days): Up to 68% savings on infrequently accessed objects
- After Glacier (90+ days): ~$0.36/month for archived objects
- Estimated monthly savings: $20-50+ depending on access patterns and bucket size
The savings scale with bucket size, making lifecycle rules especially impactful for large storage deployments.
Alternative Approaches
- Intelligent-Tiering only: If you're unsure of access patterns, using only Intelligent-Tiering with no Glacier transition is safer — it automatically optimizes without risking slow retrieval times
- Expiration rules: If objects have a known useful lifespan, add an expiration action (e.g., delete after 365 days) to eliminate storage costs entirely for old data
- Filter by prefix: Instead of applying to all objects, scope the rule to specific prefixes (e.g.,
logs/,backups/) if only certain data should be transitioned - AWS CLI / Infrastructure as Code: For managing lifecycle policies across many buckets, use
aws s3api put-bucket-lifecycle-configurationor define policies in CloudFormation/CDK/Terraform
Best Practices
- Start with Intelligent-Tiering: It's the safest first step since it adapts to access patterns automatically
- Be cautious with Glacier: Objects in Glacier have retrieval delays (3-5 hours for standard retrieval) and retrieval costs — only archive data you rarely need
- Monitor with S3 Storage Lens: Use Storage Lens to track how your storage class distribution changes after enabling lifecycle rules
- Review before adding expiration: Expiration permanently deletes objects — ensure you have backups or versioning enabled before adding delete rules
Troubleshooting
Rule not taking effect: Lifecycle rules are evaluated once per day. Allow 24-48 hours for transitions to begin.
Objects not transitioning: Objects smaller than 128 KB are not transitioned to Intelligent-Tiering. Glacier has a minimum storage duration of 90 days — early deletion incurs pro-rated charges.
Unexpected costs after enabling Glacier: Glacier has minimum storage duration charges. If objects are deleted or overwritten before 90 days, you'll still be charged for the full 90-day minimum.
Related Resources
Conclusion
Configuring S3 lifecycle rules is a straightforward way to reduce storage costs for large buckets. By transitioning objects to Intelligent-Tiering after 30 days and Glacier Flexible Retrieval after 90 days, you can achieve significant savings without any changes to your application. The rules run automatically in the background, making this a "set and forget" optimization.