From f2d5bd90ea2edcaadf8bc2545d07cdae42e1a765 Mon Sep 17 00:00:00 2001 From: Will Gibson <8738245+WillGibson@users.noreply.github.com> Date: Wed, 10 Apr 2024 13:19:57 +0100 Subject: [PATCH] docs: Document using Terraform Workspaces (#57) --- README.md | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 8e15c4b3..f67e7188 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,18 @@ # Terraform platform modules +## Using [Terraform workspaces](https://developer.hashicorp.com/terraform/language/state/workspaces) for development + +In your `-deploy` codebase: + +- `aws sso login` +- `cd terraform` +- `terraform init` +- If first time `terraform workspace new ` else `terraform workspace select ` + - `workspace` will normally be the name of your environment +- Change name of environments/spaces in `.tf` to your environment/space + - This step should go away in due course, but for now we need to do this and not commit the changes to `main` +- `terraform plan|apply` + ## Testing The short tests that run against the `terraform plan` for a module can be run by `cd`-ing into the module folder and running: @@ -8,7 +21,7 @@ The short tests that run against the `terraform plan` for a module can be run by terraform test ``` -To run the longer end to end tests that actually deploy the module (via `terrafrom apply`), perform assertions and tear back down are run from the +To run the longer end-to-end tests that actually deploy the module (via `terraform apply`), perform assertions and tear back down are run from the same directory as follows: ```shell