From 8baff6ea14b32f414289db2a13f5706219fcdb0c Mon Sep 17 00:00:00 2001 From: Sam Levenick Date: Mon, 9 Dec 2019 18:34:05 +0000 Subject: [PATCH] Add org_id to organization datasource so we don't need to use id Signed-off-by: Modular Magician --- google/data_source_google_organization.go | 5 +++++ website/docs/d/google_organization.html.markdown | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/google/data_source_google_organization.go b/google/data_source_google_organization.go index eed599e1e54..a986193a1f7 100644 --- a/google/data_source_google_organization.go +++ b/google/data_source_google_organization.go @@ -24,6 +24,10 @@ func dataSourceGoogleOrganization() *schema.Resource { Optional: true, ConflictsWith: []string{"domain"}, }, + "org_id": { + Type: schema.TypeString, + Computed: true, + }, "name": { Type: schema.TypeString, Computed: true, @@ -78,6 +82,7 @@ func dataSourceOrganizationRead(d *schema.ResourceData, meta interface{}) error d.SetId(organization.Name) d.Set("name", organization.Name) + d.Set("org_id", GetResourceNameFromSelfLink(organization.Name)) d.Set("domain", organization.DisplayName) d.Set("create_time", organization.CreationTime) d.Set("lifecycle_state", organization.LifecycleState) diff --git a/website/docs/d/google_organization.html.markdown b/website/docs/d/google_organization.html.markdown index d9479242388..498804061c2 100644 --- a/website/docs/d/google_organization.html.markdown +++ b/website/docs/d/google_organization.html.markdown @@ -37,7 +37,7 @@ The following arguments are supported: The following additional attributes are exported: -* `id` - The Organization ID. +* `org_id` - The Organization ID. * `name` - The resource name of the Organization in the form `organizations/{organization_id}`. * `directory_customer_id` - The Google for Work customer ID of the Organization. * `create_time` - Timestamp when the Organization was created. A timestamp in RFC3339 UTC "Zulu" format, accurate to nanoseconds. Example: "2014-10-02T15:01:23.045123456Z".