Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove GCP project-specific terraform backends #5446

Merged
merged 2 commits into from
Jan 29, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Remove discussion of terraform backends from docs
sgibson91 committed Jan 29, 2025
commit a941155d6d20ee883f718fc87b978fd96f674d52
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
@@ -333,7 +333,7 @@ terraform init
:sync: gcp-key
```bash
cd terraform/gcp
terraform init -backend-config=backends/default-backend.hcl -reconfigure
terraform init
```
````

@@ -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.
30 changes: 1 addition & 29 deletions docs/topic/infrastructure/terraform.md
Original file line number Diff line number Diff line change
@@ -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.
```
@@ -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
```