S3 Lifecycle to Intelligent-Tiering
π¦ Overviewβ
This Terraform module applies a lifecycle rule to an existing Amazon S3 bucket, automatically transitioning objects to the INTELLIGENT_TIERING storage class after 30 days.
Itβs ideal for production or archive environments where access patterns are unpredictable and manual tiering is inefficient.
β Key Featuresβ
- Automatically transitions S3 objects to
INTELLIGENT_TIERINGafter 30 days - Reduces costs while maintaining high availability and low latency
- Adapts to shifting access patterns without user intervention
- Supports tagging and is reusable across environments
πΌ Use Casesβ
- Data lakes with variable or unknown access patterns
- Long-term logs, backups, or exports with inconsistent access
- Secure buckets needing smarter storage management
- Cost-conscious workloads that require availability but not tiering oversight
π₯ Input Variablesβ
| Name | Type | Description |
|---|---|---|
| region | string | AWS region where the target S3 bucket exists |
| bucket_name | string | Name of the S3 bucket to apply the lifecycle rule to |
| transition_days | number | Number of days before transitioning objects to INTELLIGENT_TIERING |
| environment | string | Tag to specify the deployment environment (e.g., dev, staging, prod) |
π€ Outputsβ
| Name | Description |
|---|---|
| bucket_name | The name of the S3 bucket with the lifecycle rule |
| rule_id | The ID of the lifecycle rule applied |
π Deployment Readinessβ
- β Compatible with Terraform 1.0+
- β Tested with AWS provider 5.x
- π§ͺ Requires an existing S3 bucket and permissions to apply lifecycle policies
π οΈ Example Usageβ
module "s3_lifecycle_intelligent_tiering" {
source = "git::ssh://git@github.com/archiphire/aws-level-1-modules.git//storage/s3-lifecycle-intelligent-tiering?ref=v1.0.0"
region = "us-east-1"
bucket_name = "archiphire-prod-data"
transition_days = 30
environment = "prod"
}
terraform init
terraform plan
terraform apply
or
tofu init
tofu plan
tofu apply
π§Ή Cleanup Optionsβ
Terraform Destroy (for test environments):
terraform destroy
or
tofu destroy
β οΈ This only removes the lifecycle rule. Your S3 bucket and its contents will remain unaffected unless manually deleted.
π‘οΈ Notesβ
This is a Level 1 storage optimization module focused on cost control. To extend it further, consider pairing with:
s3-secure-bucket s3-access-logging
π Deployment Package Noticeβ
This module is part of the Level 1 AWS License Tier. To access the full deployment package and source code, subscribe to Archiphire.