[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
08/14: cdn: Add a lifecycle policy to the state bucket.
From: |
Chris Marusich |
Subject: |
08/14: cdn: Add a lifecycle policy to the state bucket. |
Date: |
Sat, 29 Dec 2018 02:04:55 -0500 (EST) |
marusich pushed a commit to branch master
in repository maintenance.
commit 5129c651780bb70b4885b9e4925cb20dd128b974
Author: Chris Marusich <address@hidden>
Date: Fri Dec 28 03:21:11 2018 -0800
cdn: Add a lifecycle policy to the state bucket.
* cdn/terraform/main.tf (guix-terraform-state) <lifecycle_rule>: New
lifecycle rule.
---
cdn/terraform/main.tf | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/cdn/terraform/main.tf b/cdn/terraform/main.tf
index 7c1fbdd..e36ae6b 100644
--- a/cdn/terraform/main.tf
+++ b/cdn/terraform/main.tf
@@ -2,6 +2,7 @@
# https://www.terraform.io/docs/backends/types/s3.html
terraform {
backend "s3" {
+ # TODO: Add a Dynamo DB table for locking.
bucket = "guix-terraform-state"
key = "state"
region = "us-west-2"
@@ -291,6 +292,23 @@ resource "aws_s3_bucket" "guix-terraform-state" {
}
}
}
+ # The intent of this rule is to retain the current version and zero
+ # or more recent non-current versions, while preventing the size of
+ # the bucket from growing out of hand.
+ lifecycle_rule {
+ id = "clean-up"
+ enabled = true
+ # It seems unlikely that Terraform would use multi-part uploads to
+ # upload the state, since the state is small, but just in case,
+ # let's automatically abort any stuck multi-part uploads.
+ # TODO: Increase this to 7 days after initial testing is over.
+ abort_incomplete_multipart_upload_days = 1
+ # Clean up old non-current versions.
+ # TODO: Increase this to 14 days after initial testing is over.
+ noncurrent_version_expiration {
+ days = 1
+ }
+ }
lifecycle {
prevent_destroy = true
}
- branch master updated (777e9e1 -> 5b68c2f), Chris Marusich, 2018/12/29
- 14/14: cdn: Add an example command to the README.org., Chris Marusich, 2018/12/29
- 11/14: cdn: Provision a TLS certificate for ci.guix.info., Chris Marusich, 2018/12/29
- 07/14: cdn: Use Terraform's S3 backend., Chris Marusich, 2018/12/29
- 13/14: cdn: Add billing alarms., Chris Marusich, 2018/12/29
- 10/14: cdn: Switch default region to us-east-1., Chris Marusich, 2018/12/29
- 08/14: cdn: Add a lifecycle policy to the state bucket.,
Chris Marusich <=
- 06/14: cdn: Add an S3 bucket to hold Terraform state., Chris Marusich, 2018/12/29
- 12/14: cdn: Allow clients to use both HTTP and HTTPS., Chris Marusich, 2018/12/29
- 04/14: cdn: Do not hard-code the profile name., Chris Marusich, 2018/12/29
- 02/14: cdn: Give Ludo and Ricardo administrative access., Chris Marusich, 2018/12/29
- 05/14: cdn: Add a CloudFront distribution fronting berlin., Chris Marusich, 2018/12/29
- 03/14: cdn: Add thoughts about next steps to README., Chris Marusich, 2018/12/29
- 01/14: cdn: Initial commit of Terraform configuration., Chris Marusich, 2018/12/29
- 09/14: cdn: Add a basic deployment plan to the README.org, Chris Marusich, 2018/12/29