marusich pushed a commit to branch master
in repository maintenance.
commit 01189233b6ca9ab4104eb39be4eeff2bbec0e7fb
Author: Chris Marusich <[email protected]>
Date: Fri Dec 28 02:55:50 2018 -0800
cdn: Use Terraform's S3 backend.
* cdn/terraform/main.tf (terraform): New object, with an s3 backend.
* cdn/README.org: Update accordingly.
---
cdn/README.org | 7 +++----
cdn/terraform/main.tf | 10 ++++++++++
2 files changed, 13 insertions(+), 4 deletions(-)
diff --git a/cdn/README.org b/cdn/README.org
index bed9562..e030202 100644
--- a/cdn/README.org
+++ b/cdn/README.org
@@ -859,10 +859,9 @@ So, let's get started! Let's set up S3 without DynamoDB
first.
- Back up the state.
- modify the main.tf file
-- Run "terraform init"
-- Ignore .terraform directory from version control (already done!)
-
-
+- Run "terraform init" and say "yes" when it prompts you if you want
+ to copy existing state into the new backend.
+- Ignore .terraform directory from version control
* Configuration strucure
There can be multiple files (*.tf, *.tfvars), or just one file. Name
diff --git a/cdn/terraform/main.tf b/cdn/terraform/main.tf
index 2ea6516..7c1fbdd 100644
--- a/cdn/terraform/main.tf
+++ b/cdn/terraform/main.tf
@@ -1,3 +1,13 @@
+# Backend documentation:
+# https://www.terraform.io/docs/backends/types/s3.html
+terraform {
+ backend "s3" {
+ bucket = "guix-terraform-state"
+ key = "state"
+ region = "us-west-2"
+ }
+}
+
# Provider documentation: https://www.terraform.io/docs/providers/aws
#
# Some AWS credentials documentation: