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

vcd.getVappNetwork

Explore with Pulumi AI

vcd logo
vcd 3.14.1 published on Monday, Apr 14, 2025 by vmware

    Provides a VMware Cloud Director vApp network data source. This can be used to access a vApp network.

    Supported in provider v2.7+

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as vcd from "@pulumi/vcd";
    
    const web = vcd.getVapp({
        name: "web",
    });
    const network1 = web.then(web => vcd.getVappNetwork({
        vappName: web.name,
        name: "isolated-network",
    }));
    export const gateway = network1.then(network1 => network1.gateway);
    
    import pulumi
    import pulumi_vcd as vcd
    
    web = vcd.get_vapp(name="web")
    network1 = vcd.get_vapp_network(vapp_name=web.name,
        name="isolated-network")
    pulumi.export("gateway", network1.gateway)
    
    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 {
    		web, err := vcd.LookupVapp(ctx, &vcd.LookupVappArgs{
    			Name: "web",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		network1, err := vcd.LookupVappNetwork(ctx, &vcd.LookupVappNetworkArgs{
    			VappName: web.Name,
    			Name:     "isolated-network",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("gateway", network1.Gateway)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Vcd = Pulumi.Vcd;
    
    return await Deployment.RunAsync(() => 
    {
        var web = Vcd.GetVapp.Invoke(new()
        {
            Name = "web",
        });
    
        var network1 = Vcd.GetVappNetwork.Invoke(new()
        {
            VappName = web.Apply(getVappResult => getVappResult.Name),
            Name = "isolated-network",
        });
    
        return new Dictionary<string, object?>
        {
            ["gateway"] = network1.Apply(getVappNetworkResult => getVappNetworkResult.Gateway),
        };
    });
    
    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 com.pulumi.vcd.inputs.GetVappNetworkArgs;
    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 web = VcdFunctions.getVapp(GetVappArgs.builder()
                .name("web")
                .build());
    
            final var network1 = VcdFunctions.getVappNetwork(GetVappNetworkArgs.builder()
                .vappName(web.applyValue(getVappResult -> getVappResult.name()))
                .name("isolated-network")
                .build());
    
            ctx.export("gateway", network1.applyValue(getVappNetworkResult -> getVappNetworkResult.gateway()));
        }
    }
    
    variables:
      web:
        fn::invoke:
          function: vcd:getVapp
          arguments:
            name: web
      network1:
        fn::invoke:
          function: vcd:getVappNetwork
          arguments:
            vappName: ${web.name}
            name: isolated-network
    outputs:
      gateway: ${network1.gateway}
    

    Using getVappNetwork

    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 getVappNetwork(args: GetVappNetworkArgs, opts?: InvokeOptions): Promise<GetVappNetworkResult>
    function getVappNetworkOutput(args: GetVappNetworkOutputArgs, opts?: InvokeOptions): Output<GetVappNetworkResult>
    def get_vapp_network(id: Optional[str] = None,
                         name: Optional[str] = None,
                         org: Optional[str] = None,
                         vapp_name: Optional[str] = None,
                         vdc: Optional[str] = None,
                         opts: Optional[InvokeOptions] = None) -> GetVappNetworkResult
    def get_vapp_network_output(id: Optional[pulumi.Input[str]] = None,
                         name: Optional[pulumi.Input[str]] = None,
                         org: Optional[pulumi.Input[str]] = None,
                         vapp_name: Optional[pulumi.Input[str]] = None,
                         vdc: Optional[pulumi.Input[str]] = None,
                         opts: Optional[InvokeOptions] = None) -> Output[GetVappNetworkResult]
    func LookupVappNetwork(ctx *Context, args *LookupVappNetworkArgs, opts ...InvokeOption) (*LookupVappNetworkResult, error)
    func LookupVappNetworkOutput(ctx *Context, args *LookupVappNetworkOutputArgs, opts ...InvokeOption) LookupVappNetworkResultOutput

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

    public static class GetVappNetwork 
    {
        public static Task<GetVappNetworkResult> InvokeAsync(GetVappNetworkArgs args, InvokeOptions? opts = null)
        public static Output<GetVappNetworkResult> Invoke(GetVappNetworkInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetVappNetworkResult> getVappNetwork(GetVappNetworkArgs args, InvokeOptions options)
    public static Output<GetVappNetworkResult> getVappNetwork(GetVappNetworkArgs args, InvokeOptions options)
    
    fn::invoke:
      function: vcd:index/getVappNetwork:getVappNetwork
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Name string
    A name for the vApp network, unique within the vApp
    VappName string
    The vApp name.
    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 string
    A name for the vApp network, unique within the vApp
    VappName string
    The vApp name.
    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 String
    A name for the vApp network, unique within the vApp
    vappName String
    The vApp name.
    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 string
    A name for the vApp network, unique within the vApp
    vappName string
    The vApp name.
    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 str
    A name for the vApp network, unique within the vApp
    vapp_name str
    The vApp name.
    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 String
    A name for the vApp network, unique within the vApp
    vappName String
    The vApp name.
    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

    getVappNetwork Result

    The following output properties are available:

    Supporting Types

    GetVappNetworkDhcpPool

    GetVappNetworkStaticIpPool

    Package Details

    Repository
    vcd vmware/terraform-provider-vcd
    License
    Notes
    This Pulumi package is based on the vcd Terraform Provider.
    vcd logo
    vcd 3.14.1 published on Monday, Apr 14, 2025 by vmware