/
getDatacenter.ts
53 lines (49 loc) · 1.58 KB
/
getDatacenter.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
// *** 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";
/**
* The `vsphere_datacenter` data source can be used to discover the ID of a
* vSphere datacenter. This can then be used with resources or data sources that
* require a datacenter, such as the [`vsphere_host`][data-source-vsphere-host]
* data source.
*
* [data-source-vsphere-host]: /docs/providers/vsphere/d/host.html
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as vsphere from "@pulumi/vsphere";
*
* const datacenter = pulumi.output(vsphere.getDatacenter({
* name: "dc1",
* }));
* ```
*/
export function getDatacenter(args?: GetDatacenterArgs, opts?: pulumi.InvokeOptions): Promise<GetDatacenterResult> {
args = args || {};
return pulumi.runtime.invoke("vsphere:index/getDatacenter:getDatacenter", {
"name": args.name,
}, opts);
}
/**
* A collection of arguments for invoking getDatacenter.
*/
export interface GetDatacenterArgs {
/**
* The name of the datacenter. This can be a name or path.
* Can be omitted if there is only one datacenter in your inventory.
*/
readonly name?: string;
}
/**
* A collection of values returned by getDatacenter.
*/
export interface GetDatacenterResult {
readonly name?: string;
/**
* id is the provider-assigned unique ID for this managed resource.
*/
readonly id: string;
}