From ad46a1f1190c3cb5184338bf0a874988c74dd688 Mon Sep 17 00:00:00 2001 From: Seth Vargo Date: Wed, 21 Oct 2020 10:25:54 -0400 Subject: [PATCH] Document setting versioning and lifecycle on Terraform state --- terraform/README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/terraform/README.md b/terraform/README.md index 8f8c67c4f..e51f19e8c 100644 --- a/terraform/README.md +++ b/terraform/README.md @@ -107,6 +107,18 @@ Terraform module. $ gsutil mb -p ${PROJECT_ID} gs://${PROJECT_ID}-terraform ``` + It is also **strongly recommended** that you enable versioning of this + bucket. That will enable you to access old versions of the Terraform state + for disaster recovery. + + ```text + $ gsutil versioning set on gs://${PROJECT_ID}-terraform + ``` + + You can also create a [lifecycle + policy](https://cloud.google.com/storage/docs/managing-lifecycles) to only + keep recent versions. + 1. Create a new source control repository dedicated to managing infrastructure. This example assumes the repo is named `"en-infra"`.