1. Packages
  2. Vcd Provider
  3. API Docs
  4. getVapp
vcd 3.14.1 published on Monday, Apr 14, 2025 by vmware

vcd.getVapp

Explore with Pulumi AI

Provides a VMware Cloud Director vApp data source. This can be used to reference vApps.

Supported in provider v2.5+

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as vcd from "@pulumi/vcd";

const test_tf = vcd.getVapp({
    name: "test-tf",
    org: "tf",
    vdc: "vdc-tf",
});
export const id = test_tf.then(test_tf => test_tf.id);
export const name = test_tf.then(test_tf => test_tf.name);
export const description = test_tf.then(test_tf => test_tf.description);
export const href = test_tf.then(test_tf => test_tf.href);
export const statusText = test_tf.then(test_tf => test_tf.statusText);
Copy
import pulumi
import pulumi_vcd as vcd

test_tf = vcd.get_vapp(name="test-tf",
    org="tf",
    vdc="vdc-tf")
pulumi.export("id", test_tf.id)
pulumi.export("name", test_tf.name)
pulumi.export("description", test_tf.description)
pulumi.export("href", test_tf.href)
pulumi.export("statusText", test_tf.status_text)
Copy
package main

import (
	"github.com/pulumi/pulumi-terraform-provider/sdks/go/vcd/v3/vcd"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		test_tf, err := vcd.LookupVapp(ctx, &vcd.LookupVappArgs{
			Name: "test-tf",
			Org:  pulumi.StringRef("tf"),
			Vdc:  pulumi.StringRef("vdc-tf"),
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("id", test_tf.Id)
		ctx.Export("name", test_tf.Name)
		ctx.Export("description", test_tf.Description)
		ctx.Export("href", test_tf.Href)
		ctx.Export("statusText", test_tf.StatusText)
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Vcd = Pulumi.Vcd;

return await Deployment.RunAsync(() => 
{
    var test_tf = Vcd.GetVapp.Invoke(new()
    {
        Name = "test-tf",
        Org = "tf",
        Vdc = "vdc-tf",
    });

    return new Dictionary<string, object?>
    {
        ["id"] = test_tf.Apply(test_tf => test_tf.Apply(getVappResult => getVappResult.Id)),
        ["name"] = test_tf.Apply(test_tf => test_tf.Apply(getVappResult => getVappResult.Name)),
        ["description"] = test_tf.Apply(test_tf => test_tf.Apply(getVappResult => getVappResult.Description)),
        ["href"] = test_tf.Apply(test_tf => test_tf.Apply(getVappResult => getVappResult.Href)),
        ["statusText"] = test_tf.Apply(test_tf => test_tf.Apply(getVappResult => getVappResult.StatusText)),
    };
});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.vcd.VcdFunctions;
import com.pulumi.vcd.inputs.GetVappArgs;
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 test-tf = VcdFunctions.getVapp(GetVappArgs.builder()
            .name("test-tf")
            .org("tf")
            .vdc("vdc-tf")
            .build());

        ctx.export("id", test_tf.id());
        ctx.export("name", test_tf.name());
        ctx.export("description", test_tf.description());
        ctx.export("href", test_tf.href());
        ctx.export("statusText", test_tf.statusText());
    }
}
Copy
variables:
  test-tf:
    fn::invoke:
      function: vcd:getVapp
      arguments:
        name: test-tf
        org: tf
        vdc: vdc-tf
outputs:
  id: ${["test-tf"].id}
  name: ${["test-tf"].name}
  description: ${["test-tf"].description}
  href: ${["test-tf"].href}
  statusText: ${["test-tf"].statusText}
Copy

Metadata

The metadata_entry (v3.8+) is a set of metadata entries that have the following structure:

  • key - Key of this metadata entry.
  • value - Value of this metadata entry.
  • type - Type of this metadata entry. One of: MetadataStringValue, MetadataNumberValue, MetadataDateTimeValue, MetadataBooleanValue.
  • user_access - User access level for this metadata entry. One of: PRIVATE (hidden), READONLY (read only), READWRITE (read/write).
  • is_system - Domain for this metadata entry. true if it belongs to SYSTEM, false if it belongs to GENERAL.

Using getVapp

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 getVapp(args: GetVappArgs, opts?: InvokeOptions): Promise<GetVappResult>
function getVappOutput(args: GetVappOutputArgs, opts?: InvokeOptions): Output<GetVappResult>
Copy
def get_vapp(id: Optional[str] = None,
             name: Optional[str] = None,
             org: Optional[str] = None,
             vdc: Optional[str] = None,
             opts: Optional[InvokeOptions] = None) -> GetVappResult
def get_vapp_output(id: Optional[pulumi.Input[str]] = None,
             name: Optional[pulumi.Input[str]] = None,
             org: Optional[pulumi.Input[str]] = None,
             vdc: Optional[pulumi.Input[str]] = None,
             opts: Optional[InvokeOptions] = None) -> Output[GetVappResult]
Copy
func LookupVapp(ctx *Context, args *LookupVappArgs, opts ...InvokeOption) (*LookupVappResult, error)
func LookupVappOutput(ctx *Context, args *LookupVappOutputArgs, opts ...InvokeOption) LookupVappResultOutput
Copy

> Note: This function is named LookupVapp in the Go SDK.

public static class GetVapp 
{
    public static Task<GetVappResult> InvokeAsync(GetVappArgs args, InvokeOptions? opts = null)
    public static Output<GetVappResult> Invoke(GetVappInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetVappResult> getVapp(GetVappArgs args, InvokeOptions options)
public static Output<GetVappResult> getVapp(GetVappArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: vcd:index/getVapp:getVapp
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

Name This property is required. string
A unique name for the vApp
Id string
Org string
The name of organization to use, optional if defined at provider level. Useful when connected as sysadmin working across different organisations
Vdc string
The name of VDC to use, optional if defined at provider level
Name This property is required. string
A unique name for the vApp
Id string
Org string
The name of organization to use, optional if defined at provider level. Useful when connected as sysadmin working across different organisations
Vdc string
The name of VDC to use, optional if defined at provider level
name This property is required. String
A unique name for the vApp
id String
org String
The name of organization to use, optional if defined at provider level. Useful when connected as sysadmin working across different organisations
vdc String
The name of VDC to use, optional if defined at provider level
name This property is required. string
A unique name for the vApp
id string
org string
The name of organization to use, optional if defined at provider level. Useful when connected as sysadmin working across different organisations
vdc string
The name of VDC to use, optional if defined at provider level
name This property is required. str
A unique name for the vApp
id str
org str
The name of organization to use, optional if defined at provider level. Useful when connected as sysadmin working across different organisations
vdc str
The name of VDC to use, optional if defined at provider level
name This property is required. String
A unique name for the vApp
id String
org String
The name of organization to use, optional if defined at provider level. Useful when connected as sysadmin working across different organisations
vdc String
The name of VDC to use, optional if defined at provider level

getVapp Result

The following output properties are available:

Description string
An optional description for the vApp
GuestProperties Dictionary<string, string>
Key value map of vApp guest properties.
Href string
The vApp Hyper Reference
Id string
InheritedMetadata Dictionary<string, string>
(v3.11+; VCD 10.5.1+) A map that contains read-only metadata that is automatically added by VCD (10.5.1+) and provides details on the origin of the vApp (e.g. vapp.origin.id, vapp.origin.name, vapp.origin.type).
Leases List<GetVappLease>
(v3.5+) - The information about the vApp lease. It includes the following fields:
Metadata Dictionary<string, string>
(Deprecated) Use metadata_entry instead. Key value map of metadata assigned to this vApp. Key and value can be any string.

Deprecated: Deprecated

MetadataEntries List<GetVappMetadataEntry>
A set of metadata entries assigned to this vApp. See Metadata section for details.
Name string
Status double
The vApp status as a numeric code
StatusText string
The vApp status as text.
VappNetworkNames List<string>
(3.13.0+) A list of vApp network names included in this vApp
VappOrgNetworkNames List<string>
(v3.13.0+) A list of vApp Org network names included in this vApp
VmNames List<string>
(v3.13.0+) A list of VM names included in this vApp
Org string
Vdc string
Description string
An optional description for the vApp
GuestProperties map[string]string
Key value map of vApp guest properties.
Href string
The vApp Hyper Reference
Id string
InheritedMetadata map[string]string
(v3.11+; VCD 10.5.1+) A map that contains read-only metadata that is automatically added by VCD (10.5.1+) and provides details on the origin of the vApp (e.g. vapp.origin.id, vapp.origin.name, vapp.origin.type).
Leases []GetVappLease
(v3.5+) - The information about the vApp lease. It includes the following fields:
Metadata map[string]string
(Deprecated) Use metadata_entry instead. Key value map of metadata assigned to this vApp. Key and value can be any string.

Deprecated: Deprecated

MetadataEntries []GetVappMetadataEntry
A set of metadata entries assigned to this vApp. See Metadata section for details.
Name string
Status float64
The vApp status as a numeric code
StatusText string
The vApp status as text.
VappNetworkNames []string
(3.13.0+) A list of vApp network names included in this vApp
VappOrgNetworkNames []string
(v3.13.0+) A list of vApp Org network names included in this vApp
VmNames []string
(v3.13.0+) A list of VM names included in this vApp
Org string
Vdc string
description String
An optional description for the vApp
guestProperties Map<String,String>
Key value map of vApp guest properties.
href String
The vApp Hyper Reference
id String
inheritedMetadata Map<String,String>
(v3.11+; VCD 10.5.1+) A map that contains read-only metadata that is automatically added by VCD (10.5.1+) and provides details on the origin of the vApp (e.g. vapp.origin.id, vapp.origin.name, vapp.origin.type).
leases List<GetVappLease>
(v3.5+) - The information about the vApp lease. It includes the following fields:
metadata Map<String,String>
(Deprecated) Use metadata_entry instead. Key value map of metadata assigned to this vApp. Key and value can be any string.

Deprecated: Deprecated

metadataEntries List<GetVappMetadataEntry>
A set of metadata entries assigned to this vApp. See Metadata section for details.
name String
status Double
The vApp status as a numeric code
statusText String
The vApp status as text.
vappNetworkNames List<String>
(3.13.0+) A list of vApp network names included in this vApp
vappOrgNetworkNames List<String>
(v3.13.0+) A list of vApp Org network names included in this vApp
vmNames List<String>
(v3.13.0+) A list of VM names included in this vApp
org String
vdc String
description string
An optional description for the vApp
guestProperties {[key: string]: string}
Key value map of vApp guest properties.
href string
The vApp Hyper Reference
id string
inheritedMetadata {[key: string]: string}
(v3.11+; VCD 10.5.1+) A map that contains read-only metadata that is automatically added by VCD (10.5.1+) and provides details on the origin of the vApp (e.g. vapp.origin.id, vapp.origin.name, vapp.origin.type).
leases GetVappLease[]
(v3.5+) - The information about the vApp lease. It includes the following fields:
metadata {[key: string]: string}
(Deprecated) Use metadata_entry instead. Key value map of metadata assigned to this vApp. Key and value can be any string.

Deprecated: Deprecated

metadataEntries GetVappMetadataEntry[]
A set of metadata entries assigned to this vApp. See Metadata section for details.
name string
status number
The vApp status as a numeric code
statusText string
The vApp status as text.
vappNetworkNames string[]
(3.13.0+) A list of vApp network names included in this vApp
vappOrgNetworkNames string[]
(v3.13.0+) A list of vApp Org network names included in this vApp
vmNames string[]
(v3.13.0+) A list of VM names included in this vApp
org string
vdc string
description str
An optional description for the vApp
guest_properties Mapping[str, str]
Key value map of vApp guest properties.
href str
The vApp Hyper Reference
id str
inherited_metadata Mapping[str, str]
(v3.11+; VCD 10.5.1+) A map that contains read-only metadata that is automatically added by VCD (10.5.1+) and provides details on the origin of the vApp (e.g. vapp.origin.id, vapp.origin.name, vapp.origin.type).
leases Sequence[GetVappLease]
(v3.5+) - The information about the vApp lease. It includes the following fields:
metadata Mapping[str, str]
(Deprecated) Use metadata_entry instead. Key value map of metadata assigned to this vApp. Key and value can be any string.

Deprecated: Deprecated

metadata_entries Sequence[GetVappMetadataEntry]
A set of metadata entries assigned to this vApp. See Metadata section for details.
name str
status float
The vApp status as a numeric code
status_text str
The vApp status as text.
vapp_network_names Sequence[str]
(3.13.0+) A list of vApp network names included in this vApp
vapp_org_network_names Sequence[str]
(v3.13.0+) A list of vApp Org network names included in this vApp
vm_names Sequence[str]
(v3.13.0+) A list of VM names included in this vApp
org str
vdc str
description String
An optional description for the vApp
guestProperties Map<String>
Key value map of vApp guest properties.
href String
The vApp Hyper Reference
id String
inheritedMetadata Map<String>
(v3.11+; VCD 10.5.1+) A map that contains read-only metadata that is automatically added by VCD (10.5.1+) and provides details on the origin of the vApp (e.g. vapp.origin.id, vapp.origin.name, vapp.origin.type).
leases List<Property Map>
(v3.5+) - The information about the vApp lease. It includes the following fields:
metadata Map<String>
(Deprecated) Use metadata_entry instead. Key value map of metadata assigned to this vApp. Key and value can be any string.

Deprecated: Deprecated

metadataEntries List<Property Map>
A set of metadata entries assigned to this vApp. See Metadata section for details.
name String
status Number
The vApp status as a numeric code
statusText String
The vApp status as text.
vappNetworkNames List<String>
(3.13.0+) A list of vApp network names included in this vApp
vappOrgNetworkNames List<String>
(v3.13.0+) A list of vApp Org network names included in this vApp
vmNames List<String>
(v3.13.0+) A list of VM names included in this vApp
org String
vdc String

Supporting Types

GetVappLease

RuntimeLeaseInSec This property is required. double
How long any of the VMs in the vApp can run before the vApp is automatically powered off or suspended. 0 means never expires.
StorageLeaseInSec This property is required. double
How long the vApp is available before being automatically deleted or marked as expired. 0 means never expires.
RuntimeLeaseInSec This property is required. float64
How long any of the VMs in the vApp can run before the vApp is automatically powered off or suspended. 0 means never expires.
StorageLeaseInSec This property is required. float64
How long the vApp is available before being automatically deleted or marked as expired. 0 means never expires.
runtimeLeaseInSec This property is required. Double
How long any of the VMs in the vApp can run before the vApp is automatically powered off or suspended. 0 means never expires.
storageLeaseInSec This property is required. Double
How long the vApp is available before being automatically deleted or marked as expired. 0 means never expires.
runtimeLeaseInSec This property is required. number
How long any of the VMs in the vApp can run before the vApp is automatically powered off or suspended. 0 means never expires.
storageLeaseInSec This property is required. number
How long the vApp is available before being automatically deleted or marked as expired. 0 means never expires.
runtime_lease_in_sec This property is required. float
How long any of the VMs in the vApp can run before the vApp is automatically powered off or suspended. 0 means never expires.
storage_lease_in_sec This property is required. float
How long the vApp is available before being automatically deleted or marked as expired. 0 means never expires.
runtimeLeaseInSec This property is required. Number
How long any of the VMs in the vApp can run before the vApp is automatically powered off or suspended. 0 means never expires.
storageLeaseInSec This property is required. Number
How long the vApp is available before being automatically deleted or marked as expired. 0 means never expires.

GetVappMetadataEntry

IsSystem This property is required. bool
Key This property is required. string
Type This property is required. string
UserAccess This property is required. string
Value This property is required. string
IsSystem This property is required. bool
Key This property is required. string
Type This property is required. string
UserAccess This property is required. string
Value This property is required. string
isSystem This property is required. Boolean
key This property is required. String
type This property is required. String
userAccess This property is required. String
value This property is required. String
isSystem This property is required. boolean
key This property is required. string
type This property is required. string
userAccess This property is required. string
value This property is required. string
is_system This property is required. bool
key This property is required. str
type This property is required. str
user_access This property is required. str
value This property is required. str
isSystem This property is required. Boolean
key This property is required. String
type This property is required. String
userAccess This property is required. String
value This property is required. String

Package Details

Repository
vcd vmware/terraform-provider-vcd
License
Notes
This Pulumi package is based on the vcd Terraform Provider.