vsphere.getDatastoreCluster
The vsphere.DatastoreCluster
data source can be used to discover the ID of a
vSphere datastore cluster object. This can then be used with resources or data sources
that require a datastore. For example, to assign datastores using the
vsphere.NasDatastore
or vsphere.VmfsDatastore
resources, or to create virtual machines in using the vsphere.VirtualMachine
resource.
Example Usage
using Pulumi;
using VSphere = Pulumi.VSphere;
class MyStack : Stack
{
public MyStack()
{
var datacenter = Output.Create(VSphere.GetDatacenter.InvokeAsync(new VSphere.GetDatacenterArgs
{
Name = "dc-01",
}));
var datastoreCluster = datacenter.Apply(datacenter => Output.Create(VSphere.GetDatastoreCluster.InvokeAsync(new VSphere.GetDatastoreClusterArgs
{
Name = "datastore-cluster-01",
DatacenterId = datacenter.Id,
})));
}
}
package main
import (
"github.com/pulumi/pulumi-vsphere/sdk/v4/go/vsphere"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
datacenter, err := vsphere.LookupDatacenter(ctx, &GetDatacenterArgs{
Name: pulumi.StringRef("dc-01"),
}, nil)
if err != nil {
return err
}
_, err = vsphere.LookupDatastoreCluster(ctx, &GetDatastoreClusterArgs{
Name: "datastore-cluster-01",
DatacenterId: pulumi.StringRef(datacenter.Id),
}, nil)
if err != nil {
return err
}
return nil
})
}
Coming soon!
import pulumi
import pulumi_vsphere as vsphere
datacenter = vsphere.get_datacenter(name="dc-01")
datastore_cluster = vsphere.get_datastore_cluster(name="datastore-cluster-01",
datacenter_id=datacenter.id)
import * as pulumi from "@pulumi/pulumi";
import * as vsphere from "@pulumi/vsphere";
const datacenter = vsphere.getDatacenter({
name: "dc-01",
});
const datastoreCluster = datacenter.then(datacenter => vsphere.getDatastoreCluster({
name: "datastore-cluster-01",
datacenterId: datacenter.id,
}));
Coming soon!
Using getDatastoreCluster
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getDatastoreCluster(args: GetDatastoreClusterArgs, opts?: InvokeOptions): Promise<GetDatastoreClusterResult>
function getDatastoreClusterOutput(args: GetDatastoreClusterOutputArgs, opts?: InvokeOptions): Output<GetDatastoreClusterResult>
def get_datastore_cluster(datacenter_id: Optional[str] = None,
name: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetDatastoreClusterResult
def get_datastore_cluster_output(datacenter_id: Optional[pulumi.Input[str]] = None,
name: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetDatastoreClusterResult]
func LookupDatastoreCluster(ctx *Context, args *LookupDatastoreClusterArgs, opts ...InvokeOption) (*LookupDatastoreClusterResult, error)
func LookupDatastoreClusterOutput(ctx *Context, args *LookupDatastoreClusterOutputArgs, opts ...InvokeOption) LookupDatastoreClusterResultOutput
> Note: This function is named LookupDatastoreCluster
in the Go SDK.
public static class GetDatastoreCluster
{
public static Task<GetDatastoreClusterResult> InvokeAsync(GetDatastoreClusterArgs args, InvokeOptions? opts = null)
public static Output<GetDatastoreClusterResult> Invoke(GetDatastoreClusterInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetDatastoreClusterResult> getDatastoreCluster(GetDatastoreClusterArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
function: vsphere:index/getDatastoreCluster:getDatastoreCluster
arguments:
# arguments dictionary
The following arguments are supported:
- Name string
The name or absolute path to the datastore cluster.
- Datacenter
Id string The managed object reference ID of the datacenter the datastore cluster is located in. This can be omitted if the search path used in
name
is an absolute path. For default datacenters, use the id attribute from an emptyvsphere.Datacenter
data source.
- Name string
The name or absolute path to the datastore cluster.
- Datacenter
Id string The managed object reference ID of the datacenter the datastore cluster is located in. This can be omitted if the search path used in
name
is an absolute path. For default datacenters, use the id attribute from an emptyvsphere.Datacenter
data source.
- name String
The name or absolute path to the datastore cluster.
- datacenter
Id String The managed object reference ID of the datacenter the datastore cluster is located in. This can be omitted if the search path used in
name
is an absolute path. For default datacenters, use the id attribute from an emptyvsphere.Datacenter
data source.
- name string
The name or absolute path to the datastore cluster.
- datacenter
Id string The managed object reference ID of the datacenter the datastore cluster is located in. This can be omitted if the search path used in
name
is an absolute path. For default datacenters, use the id attribute from an emptyvsphere.Datacenter
data source.
- name str
The name or absolute path to the datastore cluster.
- datacenter_
id str The managed object reference ID of the datacenter the datastore cluster is located in. This can be omitted if the search path used in
name
is an absolute path. For default datacenters, use the id attribute from an emptyvsphere.Datacenter
data source.
- name String
The name or absolute path to the datastore cluster.
- datacenter
Id String The managed object reference ID of the datacenter the datastore cluster is located in. This can be omitted if the search path used in
name
is an absolute path. For default datacenters, use the id attribute from an emptyvsphere.Datacenter
data source.
getDatastoreCluster Result
The following output properties are available:
- Id string
The provider-assigned unique ID for this managed resource.
- Name string
- Datacenter
Id string
- Id string
The provider-assigned unique ID for this managed resource.
- Name string
- Datacenter
Id string
- id String
The provider-assigned unique ID for this managed resource.
- name String
- datacenter
Id String
- id string
The provider-assigned unique ID for this managed resource.
- name string
- datacenter
Id string
- id str
The provider-assigned unique ID for this managed resource.
- name str
- datacenter_
id str
- id String
The provider-assigned unique ID for this managed resource.
- name String
- datacenter
Id String
Package Details
- Repository
- vSphere pulumi/pulumi-vsphere
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
vsphere
Terraform Provider.