From 2471b4f843494a5827d5b9620ddf4148e1bbc22c Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Fri, 21 Feb 2020 22:15:32 +0000 Subject: [PATCH] Move backend to S3 based --- .gitignore | 1 + scripts/terraform-apply.sh | 2 ++ scripts/terraform-plan.sh | 2 ++ terraform/backends.tf | 8 ++++++++ 4 files changed, 13 insertions(+) create mode 100644 terraform/backends.tf diff --git a/.gitignore b/.gitignore index 9ab2214..aa6016e 100644 --- a/.gitignore +++ b/.gitignore @@ -150,3 +150,4 @@ override.tf.json # End of https://www.gitignore.io/api/terraform terraform/secrets.auto.tfvars +terraform/secrets.sh diff --git a/scripts/terraform-apply.sh b/scripts/terraform-apply.sh index 0023776..fc39343 100755 --- a/scripts/terraform-apply.sh +++ b/scripts/terraform-apply.sh @@ -4,4 +4,6 @@ set -ex cd terraform/ +source secrets.sh + terraform apply diff --git a/scripts/terraform-plan.sh b/scripts/terraform-plan.sh index a1ec465..c5d86d5 100755 --- a/scripts/terraform-plan.sh +++ b/scripts/terraform-plan.sh @@ -4,4 +4,6 @@ set -ex cd terraform/ +source secrets.sh + terraform plan diff --git a/terraform/backends.tf b/terraform/backends.tf new file mode 100644 index 0000000..59a3339 --- /dev/null +++ b/terraform/backends.tf @@ -0,0 +1,8 @@ +terraform { + backend "s3" { + bucket = "0rng-terraform" + key = "terraform.tfstate" + encrypt = true + region = "eu-west-2" + } +}