mirror of
https://github.com/letic/terraform-provider-google.git
synced 2024-10-01 16:21:06 +00:00
Add GCP zone to client_config datasource (#3262)
This commit is contained in:
parent
0310ea2f75
commit
344c0a2ba6
@ -20,6 +20,11 @@ func dataSourceGoogleClientConfig() *schema.Resource {
|
|||||||
Computed: true,
|
Computed: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
"zone": {
|
||||||
|
Type: schema.TypeString,
|
||||||
|
Computed: true,
|
||||||
|
},
|
||||||
|
|
||||||
"access_token": {
|
"access_token": {
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Computed: true,
|
Computed: true,
|
||||||
@ -35,6 +40,7 @@ func dataSourceClientConfigRead(d *schema.ResourceData, meta interface{}) error
|
|||||||
d.SetId(time.Now().UTC().String())
|
d.SetId(time.Now().UTC().String())
|
||||||
d.Set("project", config.Project)
|
d.Set("project", config.Project)
|
||||||
d.Set("region", config.Region)
|
d.Set("region", config.Region)
|
||||||
|
d.Set("zone", config.Zone)
|
||||||
|
|
||||||
token, err := config.tokenSource.Token()
|
token, err := config.tokenSource.Token()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -20,6 +20,7 @@ func TestAccDataSourceGoogleClientConfig_basic(t *testing.T) {
|
|||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
resource.TestCheckResourceAttrSet(resourceName, "project"),
|
resource.TestCheckResourceAttrSet(resourceName, "project"),
|
||||||
resource.TestCheckResourceAttrSet(resourceName, "region"),
|
resource.TestCheckResourceAttrSet(resourceName, "region"),
|
||||||
|
resource.TestCheckResourceAttrSet(resourceName, "zone"),
|
||||||
resource.TestCheckResourceAttrSet(resourceName, "access_token"),
|
resource.TestCheckResourceAttrSet(resourceName, "access_token"),
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
|
@ -51,4 +51,6 @@ In addition to the arguments listed above, the following attributes are exported
|
|||||||
|
|
||||||
* `region` - The region to operate under.
|
* `region` - The region to operate under.
|
||||||
|
|
||||||
|
* `zone` - The zone to operate under.
|
||||||
|
|
||||||
* `access_token` - The OAuth2 access token used by the client to authenticate against the Google Cloud API.
|
* `access_token` - The OAuth2 access token used by the client to authenticate against the Google Cloud API.
|
||||||
|
Loading…
Reference in New Issue
Block a user