Terraform module to provide S3 Buckets dynamically
Clone this repo
- Setup AWS CLI;
- Create Terraform variables file "terraform.tfvars" with the below content:
bucket_name="reports-store"
lifecycle_rule = {
hourly = {
transition = 10,
storage_class = "STANDARD_IA"
},
daily = {
transition = 30,
storage_class = "GLACIER"
},
weekly = {
transition = 60,
storage_class = "DEEP_ARCHIVE"
}
}
The result will be three buckets named as reports-store-[key-name].
- Run Terraform;
terraform init
terraform plan
- Check if everything is ok to proceed, then apply;
terraform apply