Skip to content
This repository has been archived by the owner on Jul 1, 2023. It is now read-only.

Commit

Permalink
Remove S3 backend requirement.
Browse files Browse the repository at this point in the history
This was useful when these scripts were run from centralized
infrastructure.  However the copy in this repo has never been used that
way, and should instead be tailored towards individuals bootstrapping
a small number of environments.  No need to involve a second cloud for
that use case.
  • Loading branch information
wadells committed Mar 3, 2021
1 parent db462fd commit 2f14167
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 16 deletions.
2 changes: 2 additions & 0 deletions env/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*.tfstate
*.tfstate.backup
11 changes: 2 additions & 9 deletions env/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ NODES ?= 3
CREDS ?=

# binaries to use
AWS ?= aws
TELE ?= tele
TF ?= terraform

Expand All @@ -21,11 +20,6 @@ TF_DIR ?= terraform
# path to the public SSH key file to put on GCE instances
SSH_KEY_PATH ?=

# parameters for AWS S3 terraform backend
AWS_S3_REGION ?= us-east-1
AWS_S3_BUCKET ?= training.gravitational.io
AWS_S3_OPTS := --region $(AWS_S3_REGION) --acl public-read

# exported terraform variables
TF_VAR_node_tag := $(ENV)
TF_VAR_purpose := $(PURPOSE)
Expand Down Expand Up @@ -79,9 +73,8 @@ refresh: check-env init
.PHONY: init
init: check-env
cd ${TF_DIR} && ${TF} init -reconfigure \
-backend-config="region=$(AWS_S3_REGION)" \
-backend-config="bucket=$(AWS_S3_BUCKET)" \
-backend-config="key=terraform/$(ENV)/terraform.tfstate"
-backend-config="path=../$(ENV).tfstate"


#
# check-env makes sure ENV environment variable is set.
Expand Down
6 changes: 0 additions & 6 deletions env/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,6 @@ for Gravity workshops.
Each environment consists of 3 clean Ubuntu nodes suitable for installing
Gravity cluster. The nodes are provisioned on GCE using terraform >= v0.12.

Note, the terraform scripts use S3 backend to store terraform state, so valid
AWS credentials should be available in the environment.

To use the local backend instead, comment out the terraform backend section in
the [config.tf](./terraform/config.tf) file.

### Usage Examples

#### Provision Environment
Expand Down
2 changes: 1 addition & 1 deletion env/terraform/config.tf
Original file line number Diff line number Diff line change
Expand Up @@ -64,5 +64,5 @@ provider "google" {
}

terraform {
backend "s3" {}
backend "local" {}
}

0 comments on commit 2f14167

Please sign in to comment.