Skip to content

Commit

Permalink
e2e: make dev cluster the default Terraform vars file (#9202)
Browse files Browse the repository at this point in the history
Most of the time that a human is running the TF provisioning, they want the
"dev cluster" which is going to deploy an OSS sha, with fewer targets and
configuration alternatives. But the default `terraform.tfvars` is the nightly
E2E run. Because the nightly run is automated, there's no reason we can't have
it pick a non-default `terraform.full.tfvars` file and have the default be the
dev cluster.
  • Loading branch information
tgross authored Oct 28, 2020
1 parent 5fecb86 commit 595b450
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 30 deletions.
13 changes: 5 additions & 8 deletions e2e/terraform/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,12 @@ PKG_PATH = $(shell pwd)/../../pkg/linux_amd64/nomad

dev-cluster:
terraform apply -auto-approve \
-var="nomad_sha=$(NOMAD_SHA)" \
-var-file=terraform.tfvars.dev
-var="nomad_sha=$(NOMAD_SHA)"
terraform output environment

dev-cluster-from-local:
terraform apply -auto-approve \
-var="nomad_local_binary=$(PKG_PATH)" \
-var-file=terraform.tfvars.dev
-var="nomad_local_binary=$(PKG_PATH)"
terraform output environment

clean:
Expand All @@ -19,14 +17,13 @@ clean:
full-cluster:
terraform apply -auto-approve \
-var="nomad_sha=$(NOMAD_SHA)" \
-var-file=terraform.tfvars
-var-file=terraform.full.tfvars

plan-dev-cluster:
terraform plan \
-var="nomad_sha=$(NOMAD_SHA)" \
-var-file=terraform.tfvars.dev
-var="nomad_sha=$(NOMAD_SHA)"

plan-full-cluster:
terraform plan \
-var="nomad_sha=$(NOMAD_SHA)" \
-var-file=terraform.tfvars
-var-file=terraform.full.tfvars
6 changes: 4 additions & 2 deletions e2e/terraform/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@ cluster. This Terraform stack assumes that an appropriate instance role has
been configured elsewhere and that you have the ability to `AssumeRole` into
the AWS account.

Optionally, edit the `terraform.tfvars` file to change the number of
Linux clients or Windows clients.
Optionally, edit the `terraform.tfvars` file to change the number of Linux
clients or Windows clients. The Terraform variables file
`terraform.full.tfvars` is for the nightly E2E test run and deploys a larger,
more diverse set of test targets.

```hcl
region = "us-east-1"
Expand Down
10 changes: 10 additions & 0 deletions e2e/terraform/terraform.full.tfvars
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
region = "us-east-1"
instance_type = "t3.medium"
server_count = "3"
client_count = "4"
windows_client_count = "1"
profile = "full-cluster"
nomad_enterprise = true
nomad_acls = true
vault = true
volumes = true
16 changes: 10 additions & 6 deletions e2e/terraform/terraform.tfvars
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
region = "us-east-1"
instance_type = "t3.medium"
server_count = "3"
client_count = "4"
windows_client_count = "1"
profile = "full-cluster"
nomad_enterprise = true
nomad_acls = true
client_count = "2"
windows_client_count = "0"
profile = "dev-cluster"
nomad_acls = false
nomad_enterprise = false
vault = true
volumes = true
volumes = false

# Example overrides:
# nomad_local_binary = "../../pkg/linux_amd/nomad"
# nomad_local_binary_client_windows = ["../../pkg/windows_amd64/nomad.exe"]
14 changes: 0 additions & 14 deletions e2e/terraform/terraform.tfvars.dev

This file was deleted.

0 comments on commit 595b450

Please sign in to comment.