mirror of
https://github.com/letic/terraform-provider-google.git
synced 2024-10-04 17:51:11 +00:00
providers/google: Add account_file_contents to provider
This commit is contained in:
parent
217393d674
commit
470ea3eac0
@ -24,6 +24,7 @@ import (
|
|||||||
// provider.
|
// provider.
|
||||||
type Config struct {
|
type Config struct {
|
||||||
AccountFile string
|
AccountFile string
|
||||||
|
AccountFileContents string
|
||||||
Project string
|
Project string
|
||||||
Region string
|
Region string
|
||||||
|
|
||||||
@ -40,6 +41,9 @@ func (c *Config) loadAndValidate() error {
|
|||||||
if c.AccountFile == "" {
|
if c.AccountFile == "" {
|
||||||
c.AccountFile = os.Getenv("GOOGLE_ACCOUNT_FILE")
|
c.AccountFile = os.Getenv("GOOGLE_ACCOUNT_FILE")
|
||||||
}
|
}
|
||||||
|
if c.AccountFileContents == "" {
|
||||||
|
c.AccountFileContents = os.Getenv("GOOGLE_ACCOUNT_FILE_CONTENTS")
|
||||||
|
}
|
||||||
if c.Project == "" {
|
if c.Project == "" {
|
||||||
c.Project = os.Getenv("GOOGLE_PROJECT")
|
c.Project = os.Getenv("GOOGLE_PROJECT")
|
||||||
}
|
}
|
||||||
|
@ -15,6 +15,12 @@ func Provider() terraform.ResourceProvider {
|
|||||||
DefaultFunc: schema.EnvDefaultFunc("GOOGLE_ACCOUNT_FILE", nil),
|
DefaultFunc: schema.EnvDefaultFunc("GOOGLE_ACCOUNT_FILE", nil),
|
||||||
},
|
},
|
||||||
|
|
||||||
|
"account_file_contents": &schema.Schema{
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Optional: true,
|
||||||
|
DefaultFunc: schema.EnvDefaultFunc("GOOGLE_ACCOUNT_FILE_CONTENTS", nil),
|
||||||
|
},
|
||||||
|
|
||||||
"project": &schema.Schema{
|
"project": &schema.Schema{
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Required: true,
|
Required: true,
|
||||||
|
Loading…
Reference in New Issue
Block a user