Skip to content

Commit

Permalink
Add 'google_organization' data source (hashicorp#887)
Browse files Browse the repository at this point in the history
* Add 'google_organization' data source.

* Use 'GetResourceNameFromSelfLink'.

* Remove 'resourcemanager_helpers'.

* Use 'ConflictsWith' in schema.

* Add 'organization' argument and make 'name' an output-only attribute.
  • Loading branch information
ewbankkit authored and rosbo committed Dec 22, 2017
1 parent 5c372ab commit 39c6396
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 0 deletions.
43 changes: 43 additions & 0 deletions docs/d/google_organization.html.markdown
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
layout: "google"
page_title: "Google: google_organization"
sidebar_current: "docs-google-datasource-organization"
description: |-
Get information about a Google Cloud Organization.
---

# google\_organization

Use this data source to get information about a Google Cloud Organization.

```hcl
data "google_organization" "org" {
domain = "example.com"
}
resource "google_folder" "sales" {
display_name = "Sales"
parent = "${data.google_organization.org.name}"
}
```

## Argument Reference

The arguments of this data source act as filters for querying the available Organizations.
The given filters must match exactly one Organizations whose data will be exported as attributes.
The following arguments are supported:

* `organization` (Optional) - The name of the Organization in the form `{organization_id}` or `organizations/{organization_id}`.
* `domain` (Optional) - The domain name of the Organization.

~> **NOTE:** One of `organization` or `domain` must be specified.

## Attributes Reference

The following additional attributes are exported:

* `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".
* `lifecycle_state` - The Organization's current lifecycle state.
3 changes: 3 additions & 0 deletions google.erb
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@
<li<%= sidebar_current("docs-google-kms-secret") %>>
<a href="/docs/providers/google/d/google_kms_secret.html">google_kms_secret</a>
</li>
<li<%= sidebar_current("docs-google-datasource-organization") %>>
<a href="/docs/providers/google/d/google_organization.html">google_organization</a>
</li>
<li<%= sidebar_current("docs-google-datasource-signed_url") %>>
<a href="/docs/providers/google/d/signed_url.html">google_storage_object_signed_url</a>
</li>
Expand Down

0 comments on commit 39c6396

Please sign in to comment.