Skip to content

Commit

Permalink
update docs for TFC backend (GoogleCloudPlatform#5228)
Browse files Browse the repository at this point in the history
* update docs for TFC backend

* Update mmv1/third_party/terraform/website/docs/guides/provider_reference.html.markdown

Co-authored-by: Laura Pacilio <83350965+laurapacilio@users.noreply.github.com>

* move TFC block

* add line breaks

Co-authored-by: Laura Pacilio <83350965+laurapacilio@users.noreply.github.com>
  • Loading branch information
2 people authored and trodge committed Sep 28, 2021
1 parent 852410c commit cb1ba00
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,14 @@ quota or billing issues which don't seem to apply to you, you may want to set
-> Remember to add this line to a startup file such as `bash_profile` or
`bashrc` to store your credentials across sessions!

### Using Terraform Cloud as the Backend
You need to use a different [environment variable](https://www.terraform.io/docs/cloud/workspaces/variables.html) name to store your credentials in Terraform Cloud.
1. Create an environment variable called `GOOGLE_CREDENTIALS` in your Terraform Cloud workspace.
2. Remove the newline characters from your JSON key file and then paste the credentials into the environment variable value field.
3. Mark the variable as **Sensitive** and click **Save variable**.

All runs within the workspace will use the `GOOGLE_CREDENTIALS` variable to authenticate with Google Cloud Platform.

## Provisioning your resources
By now, your config will look something like:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,14 @@ If you are running terraform outside of Google Cloud, generate an external crede

Terraform can impersonate a Google Service Account as described [here](https://cloud.google.com/iam/docs/creating-short-lived-service-account-credentials). A valid credential must be provided as mentioned in the earlier section and that identity must have the `roles/iam.serviceAccountTokenCreator` role on the service account you are impersonating.

### Using Terraform Cloud as the Backend
Place your credentials in a Terraform Cloud [environment variable](https://www.terraform.io/docs/cloud/workspaces/variables.html):
1. Create an environment variable called `GOOGLE_CREDENTIALS` in your Terraform Cloud workspace.
2. Remove the newline characters from your JSON key file and then paste the credentials into the environment variable value field.
3. Mark the variable as **Sensitive** and click **Save variable**.

All runs within the workspace will use the `GOOGLE_CREDENTIALS` variable to authenticate with Google Cloud Platform.

## Configuration Reference

The following attributes can be used to configure the provider. The quick
Expand Down

0 comments on commit cb1ba00

Please sign in to comment.