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

update docs for TFC backend #5228

Merged
merged 4 commits into from
Sep 22, 2021
Merged
Show file tree
Hide file tree
Changes from 3 commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,13 @@ 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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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.
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,13 @@ 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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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.
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