@@ -116,8 +116,8 @@ impersonated service account regardless of the primary identity in use.
116
116
117
117
## Authentication Configuration
118
118
119
- * ` credentials ` - (Optional) Either the path to or the contents of a
120
- [ service account key file] in JSON format. You can
119
+ * ` credentials ` - (Optional) Either the path (as returned by the [ file terraform function ] )
120
+ to or the contents of a [ service account key file] in JSON format. You can
121
121
[ manage key files using the Cloud Console] . Your service account key file is
122
122
used to complete a two-legged OAuth 2.0 flow to obtain access tokens to
123
123
authenticate with the GCP API as needed; Terraform will use it to reauthenticate
@@ -136,6 +136,15 @@ by precedence.
136
136
the path of your service account key file in the
137
137
`GOOGLE_APPLICATION_CREDENTIALS` environment variable, or configure
138
138
authentication through one of the following;
139
+
140
+ ```hcl
141
+ provider "google" {
142
+ alias = "other"
143
+ project = var.my_other_project_id
144
+ region = var.region
145
+ credentials = file(pathexpand(var.gcloud_other_dac_file))
146
+ }
147
+ ```
139
148
140
149
* If you're running Terraform from a GCE instance, default credentials
141
150
are automatically available. See
@@ -414,3 +423,4 @@ See [RFC 9110](https://www.rfc-editor.org/rfc/rfc9110#field.user-agent) for form
414
423
[ gcloud adc ] : https://cloud.google.com/sdk/gcloud/reference/auth/application-default/login
415
424
[ service accounts ] : https://cloud.google.com/docs/authentication/getting-started
416
425
[ scopes ] : https://developers.google.com/identity/protocols/googlescopes
426
+ [ file terraform function ] : https://developer.hashicorp.com/terraform/language/functions/file
0 commit comments