Skip to content

Commit

Permalink
Add project variable for GCS service account datasource (#1677)
Browse files Browse the repository at this point in the history
  • Loading branch information
bcadiot authored and emilymye committed Jun 19, 2018
1 parent c7bd0cb commit 751a3d5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
10 changes: 10 additions & 0 deletions google/data_source_google_storage_project_service_account.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
},
}
}

Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 751a3d5

Please sign in to comment.