Skip to content

Commit

Permalink
Remove discussion of terraform backends from docs
Browse files Browse the repository at this point in the history
  • Loading branch information
sgibson91 committed Jan 29, 2025
1 parent 42c6db3 commit a941155
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 43 deletions.
15 changes: 1 addition & 14 deletions docs/hub-deployment-guide/new-cluster/new-cluster.md
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ terraform init
:sync: gcp-key
```bash
cd terraform/gcp
terraform init -backend-config=backends/default-backend.hcl -reconfigure
terraform init
```
````
Expand All @@ -346,19 +346,6 @@ terraform init
````
`````

````{note}
There are other backend config files stored in `terraform/backends` that will configure a different storage bucket to read/write the remote terraform state for projects which we cannot access from GCP with our `@2i2c.org` email accounts.
This saves us the pain of having to handle multiple authentications as these storage buckets are within the project we are trying to deploy to.
For example, to work with Pangeo you would initialise terraform like so:
```bash
terraform init -backend-config=pangeo-backend.hcl -reconfigure
```
<!-- TODO: add instructions on how/when to create other backends -->
````

## Creating a new terraform workspace

We use terraform workspaces so that the state of one `.tfvars` file does not influence another.
Expand Down
30 changes: 1 addition & 29 deletions docs/topic/infrastructure/terraform.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,6 @@ cd terraform/azure
terraform init
```

````{note}
Currently, since our GCP terraform config is the only one that uses different backends, an extra `-backend-config` flag needs to be passed to the `init` command to initialize.
For example, for our Pangeo projects, run:
```bash
cd terraform/gcp
terraform init -backend-config=backends/pangeo-backend.hcl
```
````

```{note}
If prior backend data exists in a `terraform.lock.hcl`, you might see an `Error: Backend configuration changed` when trying to initialize that backend. To reconfigure this backend, ignoring any saved configuration, add the `-reconfigure` flag to the init command.
```
Expand Down Expand Up @@ -92,23 +81,6 @@ terraform workspace select justiceinnovationlab
For the majority of day-to-day work, this will be the prevalent workflow provided you have initialised terraform with
```bash
terraform init -backend-config=backends/default-backend.hcl -reconfigure
terraform init
```
````
### If the new workspace is stored in a different backend to the current workspace
To change between workspaces that are stored in _different_ backends, terraform will need to be reinitialised in order to pick up the new backend.
The commands, therefore, are:
```bash
terraform init -backend-config=backends/<REQUIRED_CONFIG>.hcl -reconfigure
terraform workspace select WORKSPACE_NAME
```
For example, if you were working on our `pilot-hubs`, with our default backend initialised, but wanted to change to working on our Pangeo deployments, the commands would look as follows:
```bash
terraform init -backend-config=backends/pangeo-backend.hcl -reconfigure
terraform workspace select pangeo-hubs
```

0 comments on commit a941155

Please sign in to comment.