Add project variable for GCS service account datasource (#1677)

This commit is contained in:
Bastien Cadiot 2018-06-19 19:30:20 +02:00 committed by emily
parent c7bd0cb0f8
commit 751a3d5c9e
2 changed files with 13 additions and 1 deletions

View File

@ -7,6 +7,14 @@ import (
func dataSourceGoogleStorageProjectServiceAccount() *schema.Resource {
return &schema.Resource{
Read: dataSourceGoogleStorageProjectServiceAccountRead,
Schema: map[string]*schema.Schema{
"project": {
Type: schema.TypeString,
Computed: true,
Optional: true,
ForceNew: true,
},
},
}
}
@ -23,6 +31,8 @@ func dataSourceGoogleStorageProjectServiceAccountRead(d *schema.ResourceData, me
return handleNotFoundError(err, d, "GCS service account not found")
}
d.Set("project", project)
d.SetId(serviceAccount.EmailAddress)
return nil

View File

@ -27,7 +27,9 @@ resource "google_pubsub_topic_iam_binding" "binding" {
## Argument Reference
There are no arguments available for this data source.
The following arguments are supported:
* `project` - (Optional) The project in which the resource belongs. If it is not provided, the provider project is used.
## Attributes Reference