mirror of
https://github.com/letic/terraform-provider-google.git
synced 2024-07-06 02:02:43 +00:00
provider/google: Accept GOOGLE_CLOUD_KEYFILE_JSON env var for credentials
This commit is contained in:
parent
ef0982895d
commit
9bcd3c0ad2
|
@ -24,7 +24,10 @@ func Provider() terraform.ResourceProvider {
|
|||
"credentials": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
DefaultFunc: schema.EnvDefaultFunc("GOOGLE_CREDENTIALS", nil),
|
||||
DefaultFunc: schema.MultiEnvDefaultFunc([]string{
|
||||
"GOOGLE_CREDENTIALS",
|
||||
"GOOGLE_CLOUD_KEYFILE_JSON",
|
||||
}, nil),
|
||||
ValidateFunc: validateCredentials,
|
||||
},
|
||||
|
||||
|
|
|
@ -39,7 +39,9 @@ func testAccPreCheck(t *testing.T) {
|
|||
}
|
||||
|
||||
if v := os.Getenv("GOOGLE_CREDENTIALS"); v == "" {
|
||||
t.Fatal("GOOGLE_CREDENTIALS must be set for acceptance tests")
|
||||
if w := os.Getenv("GOOGLE_CLOUD_KEYFILE_JSON"); w == "" {
|
||||
t.Fatal("GOOGLE_CREDENTIALS or GOOGLE_CLOUD_KEYFILE_JSON must be set for acceptance tests")
|
||||
}
|
||||
}
|
||||
|
||||
if v := os.Getenv("GOOGLE_PROJECT"); v == "" {
|
||||
|
|
Loading…
Reference in New Issue
Block a user