From 751a3d5c9e8cb793609524a9866208a8ce678c77 Mon Sep 17 00:00:00 2001 From: Bastien Cadiot Date: Tue, 19 Jun 2018 19:30:20 +0200 Subject: [PATCH] Add project variable for GCS service account datasource (#1677) --- ...ta_source_google_storage_project_service_account.go | 10 ++++++++++ ...oogle_storage_project_service_account.html.markdown | 4 +++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/google/data_source_google_storage_project_service_account.go b/google/data_source_google_storage_project_service_account.go index 92cfac9d907..96543973831 100644 --- a/google/data_source_google_storage_project_service_account.go +++ b/google/data_source_google_storage_project_service_account.go @@ -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 diff --git a/website/docs/d/google_storage_project_service_account.html.markdown b/website/docs/d/google_storage_project_service_account.html.markdown index 4a179b4f609..11f339b0d4a 100644 --- a/website/docs/d/google_storage_project_service_account.html.markdown +++ b/website/docs/d/google_storage_project_service_account.html.markdown @@ -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