getOrganization

Get information about a Google Cloud Organization. Note that you must have the roles/resourcemanager.organizationViewer role (or equivalent permissions) at the organization level to use this datasource.

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const org = gcp.organizations.getOrganization({
    domain: "example.com",
});
const sales = new gcp.organizations.Folder("sales", {
    displayName: "Sales",
    parent: org.then(org => org.name),
});
import pulumi
import pulumi_gcp as gcp

org = gcp.organizations.get_organization(domain="example.com")
sales = gcp.organizations.Folder("sales",
    display_name="Sales",
    parent=org.name)
using Pulumi;
using Gcp = Pulumi.Gcp;

class MyStack : Stack
{
    public MyStack()
    {
        var org = Output.Create(Gcp.Organizations.GetOrganization.InvokeAsync(new Gcp.Organizations.GetOrganizationArgs
        {
            Domain = "example.com",
        }));
        var sales = new Gcp.Organizations.Folder("sales", new Gcp.Organizations.FolderArgs
        {
            DisplayName = "Sales",
            Parent = org.Apply(org => org.Name),
        });
    }

}
package main

import (
	"github.com/pulumi/pulumi-gcp/sdk/v5/go/gcp/organizations"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		opt0 := "example.com"
		org, err := organizations.GetOrganization(ctx, &organizations.GetOrganizationArgs{
			Domain: &opt0,
		}, nil)
		if err != nil {
			return err
		}
		_, err = organizations.NewFolder(ctx, "sales", &organizations.FolderArgs{
			DisplayName: pulumi.String("Sales"),
			Parent:      pulumi.String(org.Name),
		})
		if err != nil {
			return err
		}
		return nil
	})
}

Using getOrganization

function getOrganization(args: GetOrganizationArgs, opts?: InvokeOptions): Promise<GetOrganizationResult>
def get_organization(domain: Optional[str] = None,
                     organization: Optional[str] = None,
                     opts: Optional[InvokeOptions] = None) -> GetOrganizationResult
func GetOrganization(ctx *Context, args *GetOrganizationArgs, opts ...InvokeOption) (*GetOrganizationResult, error)

Note: This function is named GetOrganization in the Go SDK.

public static class GetOrganization {
    public static Task<GetOrganizationResult> InvokeAsync(GetOrganizationArgs args, InvokeOptions? opts = null)
}

The following arguments are supported:

Domain string
The domain name of the Organization.
Organization string
The Organization’s numeric ID, including an optional organizations/ prefix.
Domain string
The domain name of the Organization.
Organization string
The Organization’s numeric ID, including an optional organizations/ prefix.
domain string
The domain name of the Organization.
organization string
The Organization’s numeric ID, including an optional organizations/ prefix.
domain str
The domain name of the Organization.
organization str
The Organization’s numeric ID, including an optional organizations/ prefix.

getOrganization Result

The following output properties are available:

CreateTime string
Timestamp when the Organization was created. A timestamp in RFC3339 UTC “Zulu” format, accurate to nanoseconds. Example: “2014-10-02T15:01:23.045123456Z”.
DirectoryCustomerId string
The Google for Work customer ID of the Organization.
Domain string
Id string
The provider-assigned unique ID for this managed resource.
LifecycleState string
The Organization’s current lifecycle state.
Name string
The resource name of the Organization in the form organizations/{organization_id}.
OrgId string
The Organization ID.
Organization string
CreateTime string
Timestamp when the Organization was created. A timestamp in RFC3339 UTC “Zulu” format, accurate to nanoseconds. Example: “2014-10-02T15:01:23.045123456Z”.
DirectoryCustomerId string
The Google for Work customer ID of the Organization.
Domain string
Id string
The provider-assigned unique ID for this managed resource.
LifecycleState string
The Organization’s current lifecycle state.
Name string
The resource name of the Organization in the form organizations/{organization_id}.
OrgId string
The Organization ID.
Organization string
createTime string
Timestamp when the Organization was created. A timestamp in RFC3339 UTC “Zulu” format, accurate to nanoseconds. Example: “2014-10-02T15:01:23.045123456Z”.
directoryCustomerId string
The Google for Work customer ID of the Organization.
domain string
id string
The provider-assigned unique ID for this managed resource.
lifecycleState string
The Organization’s current lifecycle state.
name string
The resource name of the Organization in the form organizations/{organization_id}.
orgId string
The Organization ID.
organization string
create_time str
Timestamp when the Organization was created. A timestamp in RFC3339 UTC “Zulu” format, accurate to nanoseconds. Example: “2014-10-02T15:01:23.045123456Z”.
directory_customer_id str
The Google for Work customer ID of the Organization.
domain str
id str
The provider-assigned unique ID for this managed resource.
lifecycle_state str
The Organization’s current lifecycle state.
name str
The resource name of the Organization in the form organizations/{organization_id}.
org_id str
The Organization ID.
organization str

Package Details

Repository
https://github.com/pulumi/pulumi-gcp
License
Apache-2.0
Notes
This Pulumi package is based on the google-beta Terraform Provider.