vSphere v4.11.2 published on Tuesday, Sep 17, 2024 by Pulumi
vsphere.getVappContainer
Explore with Pulumi AI
The vsphere.VappContainer
data source can be used to discover the ID of a
vApp container in vSphere. This is useful to return the ID of a vApp container
that you want to use to create virtual machines in using the
vsphere.VirtualMachine
resource.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as vsphere from "@pulumi/vsphere";
const datacenter = vsphere.getDatacenter({
name: "dc-01",
});
const pool = datacenter.then(datacenter => vsphere.getVappContainer({
name: "vapp-container-01",
datacenterId: datacenter.id,
}));
import pulumi
import pulumi_vsphere as vsphere
datacenter = vsphere.get_datacenter(name="dc-01")
pool = vsphere.get_vapp_container(name="vapp-container-01",
datacenter_id=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, &vsphere.LookupDatacenterArgs{
Name: pulumi.StringRef("dc-01"),
}, nil)
if err != nil {
return err
}
_, err = vsphere.LookupVappContainer(ctx, &vsphere.LookupVappContainerArgs{
Name: "vapp-container-01",
DatacenterId: datacenter.Id,
}, nil)
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using VSphere = Pulumi.VSphere;
return await Deployment.RunAsync(() =>
{
var datacenter = VSphere.GetDatacenter.Invoke(new()
{
Name = "dc-01",
});
var pool = VSphere.GetVappContainer.Invoke(new()
{
Name = "vapp-container-01",
DatacenterId = datacenter.Apply(getDatacenterResult => getDatacenterResult.Id),
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.vsphere.VsphereFunctions;
import com.pulumi.vsphere.inputs.GetDatacenterArgs;
import com.pulumi.vsphere.inputs.GetVappContainerArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
final var datacenter = VsphereFunctions.getDatacenter(GetDatacenterArgs.builder()
.name("dc-01")
.build());
final var pool = VsphereFunctions.getVappContainer(GetVappContainerArgs.builder()
.name("vapp-container-01")
.datacenterId(datacenter.applyValue(getDatacenterResult -> getDatacenterResult.id()))
.build());
}
}
variables:
datacenter:
fn::invoke:
Function: vsphere:getDatacenter
Arguments:
name: dc-01
pool:
fn::invoke:
Function: vsphere:getVappContainer
Arguments:
name: vapp-container-01
datacenterId: ${datacenter.id}
Using getVappContainer
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 getVappContainer(args: GetVappContainerArgs, opts?: InvokeOptions): Promise<GetVappContainerResult>
function getVappContainerOutput(args: GetVappContainerOutputArgs, opts?: InvokeOptions): Output<GetVappContainerResult>
def get_vapp_container(datacenter_id: Optional[str] = None,
name: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetVappContainerResult
def get_vapp_container_output(datacenter_id: Optional[pulumi.Input[str]] = None,
name: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetVappContainerResult]
func LookupVappContainer(ctx *Context, args *LookupVappContainerArgs, opts ...InvokeOption) (*LookupVappContainerResult, error)
func LookupVappContainerOutput(ctx *Context, args *LookupVappContainerOutputArgs, opts ...InvokeOption) LookupVappContainerResultOutput
> Note: This function is named LookupVappContainer
in the Go SDK.
public static class GetVappContainer
{
public static Task<GetVappContainerResult> InvokeAsync(GetVappContainerArgs args, InvokeOptions? opts = null)
public static Output<GetVappContainerResult> Invoke(GetVappContainerInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetVappContainerResult> getVappContainer(GetVappContainerArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
function: vsphere:index/getVappContainer:getVappContainer
arguments:
# arguments dictionary
The following arguments are supported:
- Datacenter
Id string - The managed object reference ID of the datacenter in which the vApp container is located.
- Name string
- The name of the vApp container. This can be a name or path.
- Datacenter
Id string - The managed object reference ID of the datacenter in which the vApp container is located.
- Name string
- The name of the vApp container. This can be a name or path.
- datacenter
Id String - The managed object reference ID of the datacenter in which the vApp container is located.
- name String
- The name of the vApp container. This can be a name or path.
- datacenter
Id string - The managed object reference ID of the datacenter in which the vApp container is located.
- 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 in which the vApp container is located.
- name str
- The name of the vApp container. This can be a name or path.
- datacenter
Id String - The managed object reference ID of the datacenter in which the vApp container is located.
- name String
- The name of the vApp container. This can be a name or path.
getVappContainer Result
The following output properties are available:
- 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 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
- datacenter
Id String - id String
- The provider-assigned unique ID for this managed resource.
- name String
Package Details
- Repository
- vSphere pulumi/pulumi-vsphere
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
vsphere
Terraform Provider.