Ready to level-up your engineering skills? Join a Pulumi Workshop. Register Now

getVappContainer

The vsphere.VappContainer data source can be used to discover the ID of a vApp container in vSphere. This is useful to fetch the ID of a vApp container that you want to use 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 = "dc1",
        }));
        var pool = datacenter.Apply(datacenter => Output.Create(VSphere.GetVappContainer.InvokeAsync(new VSphere.GetVappContainerArgs
        {
            DatacenterId = datacenter.Id,
            Name = "vapp-container-1",
        })));
    }

}
package main

import (
    "github.com/pulumi/pulumi-vsphere/sdk/v2/go/vsphere"
    "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)

func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
        opt0 := "dc1"
        datacenter, err := vsphere.LookupDatacenter(ctx, &vsphere.LookupDatacenterArgs{
            Name: &opt0,
        }, nil)
        if err != nil {
            return err
        }
        _, err = vsphere.LookupVappContainer(ctx, &vsphere.LookupVappContainerArgs{
            DatacenterId: datacenter.Id,
            Name:         "vapp-container-1",
        }, nil)
        if err != nil {
            return err
        }
        return nil
    })
}
import pulumi
import pulumi_vsphere as vsphere

datacenter = vsphere.get_datacenter(name="dc1")
pool = vsphere.get_vapp_container(datacenter_id=datacenter.id,
    name="vapp-container-1")
import * as pulumi from "@pulumi/pulumi";
import * as vsphere from "@pulumi/vsphere";

const datacenter = pulumi.output(vsphere.getDatacenter({
    name: "dc1",
}, { async: true }));
const pool = datacenter.apply(datacenter => vsphere.getVappContainer({
    datacenterId: datacenter.id,
    name: "vapp-container-1",
}, { async: true }));

Using getVappContainer

function getVappContainer(args: GetVappContainerArgs, opts?: InvokeOptions): Promise<GetVappContainerResult>
def get_vapp_container(datacenter_id: Optional[str] = None, name: Optional[str] = None, opts: Optional[InvokeOptions] = None) -> GetVappContainerResult
func LookupVappContainer(ctx *Context, args *LookupVappContainerArgs, opts ...InvokeOption) (*LookupVappContainerResult, error)

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

public static class GetVappContainer {
    public static Task<GetVappContainerResult> InvokeAsync(GetVappContainerArgs args, InvokeOptions? opts = null)
}

The following arguments are supported:

DatacenterId string

The managed object reference ID of the datacenter the vApp container is located in.

Name string

The name of the vApp container. This can be a name or path.

DatacenterId string

The managed object reference ID of the datacenter the vApp container is located in.

Name string

The name of the vApp container. This can be a name or path.

datacenterId string

The managed object reference ID of the datacenter the vApp container is located in.

name string

The name of the vApp container. This can be a name or path.

datacenter_id str

The managed object reference ID of the datacenter the vApp container is located in.

name str

The name of the vApp container. This can be a name or path.

getVappContainer Result

The following output properties are available:

DatacenterId string
Id string

The provider-assigned unique ID for this managed resource.

Name string
DatacenterId string
Id string

The provider-assigned unique ID for this managed resource.

Name string
datacenterId string
id string

The provider-assigned unique ID for this managed resource.

name string
datacenter_id str
id str

The provider-assigned unique ID for this managed resource.

name str

Package Details

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