/
getFolder.ts
90 lines (85 loc) · 2.68 KB
/
getFolder.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
import * as pulumi from "@pulumi/pulumi";
import * as utilities from "../utilities";
/**
* Use this data source to get information about a Google Cloud Folder.
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* // Get folder by id
* const myFolder1 = pulumi.output(gcp.organizations.getFolder({
* folder: "folders/12345",
* lookupOrganization: true,
* }));
* // Search by fields
* const myFolder2 = pulumi.output(gcp.organizations.getFolder({
* folder: "folders/23456",
* }));
*
* export const myFolder1Organization = myFolder1.organization;
* export const myFolder2Parent = myFolder2.parent;
* ```
*/
export function getFolder(args: GetFolderArgs, opts?: pulumi.InvokeOptions): Promise<GetFolderResult> {
if (!opts) {
opts = {}
}
if (!opts.version) {
opts.version = utilities.getVersion();
}
return pulumi.runtime.invoke("gcp:organizations/getFolder:getFolder", {
"folder": args.folder,
"lookupOrganization": args.lookupOrganization,
}, opts);
}
/**
* A collection of arguments for invoking getFolder.
*/
export interface GetFolderArgs {
/**
* The name of the Folder in the form `{folder_id}` or `folders/{folder_id}`.
*/
readonly folder: string;
/**
* `true` to find the organization that the folder belongs, `false` to avoid the lookup. It searches up the tree. (defaults to `false`)
*/
readonly lookupOrganization?: boolean;
}
/**
* A collection of values returned by getFolder.
*/
export interface GetFolderResult {
/**
* Timestamp when the Organization was created. A timestamp in RFC3339 UTC "Zulu" format, accurate to nanoseconds. Example: "2014-10-02T15:01:23.045123456Z".
*/
readonly createTime: string;
/**
* The folder's display name.
*/
readonly displayName: string;
readonly folder: string;
/**
* The Folder's current lifecycle state.
*/
readonly lifecycleState: string;
readonly lookupOrganization?: boolean;
/**
* The resource name of the Folder in the form `folders/{folder_id}`.
*/
readonly name: string;
/**
* If `lookup_organization` is enable, the resource name of the Organization that the folder belongs.
*/
readonly organization: string;
/**
* The resource name of the parent Folder or Organization.
*/
readonly parent: string;
/**
* id is the provider-assigned unique ID for this managed resource.
*/
readonly id: string;
}