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

vcd.getNsxtNetworkDhcpBinding

Explore with Pulumi AI

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

    Provides a data source to read NSX-T Org VDC network DHCP bindings.

    This data source requires VCD 10.3.1+

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as vcd from "@pulumi/vcd";
    
    const pools = vcd.getNsxtNetworkDhcp({
        org: "cloud",
        orgNetworkId: data.vcd_network_routed_v2.parent.id,
    });
    const binding1 = pools.then(pools => vcd.getNsxtNetworkDhcpBinding({
        org: "cloud",
        orgNetworkId: pools.id,
        name: "Binding-one",
    }));
    
    import pulumi
    import pulumi_vcd as vcd
    
    pools = vcd.get_nsxt_network_dhcp(org="cloud",
        org_network_id=data["vcd_network_routed_v2"]["parent"]["id"])
    binding1 = vcd.get_nsxt_network_dhcp_binding(org="cloud",
        org_network_id=pools.id,
        name="Binding-one")
    
    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 {
    		pools, err := vcd.LookupNsxtNetworkDhcp(ctx, &vcd.LookupNsxtNetworkDhcpArgs{
    			Org:          pulumi.StringRef("cloud"),
    			OrgNetworkId: data.Vcd_network_routed_v2.Parent.Id,
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = vcd.LookupNsxtNetworkDhcpBinding(ctx, &vcd.LookupNsxtNetworkDhcpBindingArgs{
    			Org:          pulumi.StringRef("cloud"),
    			OrgNetworkId: pools.Id,
    			Name:         "Binding-one",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Vcd = Pulumi.Vcd;
    
    return await Deployment.RunAsync(() => 
    {
        var pools = Vcd.GetNsxtNetworkDhcp.Invoke(new()
        {
            Org = "cloud",
            OrgNetworkId = data.Vcd_network_routed_v2.Parent.Id,
        });
    
        var binding1 = Vcd.GetNsxtNetworkDhcpBinding.Invoke(new()
        {
            Org = "cloud",
            OrgNetworkId = pools.Apply(getNsxtNetworkDhcpResult => getNsxtNetworkDhcpResult.Id),
            Name = "Binding-one",
        });
    
    });
    
    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.GetNsxtNetworkDhcpArgs;
    import com.pulumi.vcd.inputs.GetNsxtNetworkDhcpBindingArgs;
    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 pools = VcdFunctions.getNsxtNetworkDhcp(GetNsxtNetworkDhcpArgs.builder()
                .org("cloud")
                .orgNetworkId(data.vcd_network_routed_v2().parent().id())
                .build());
    
            final var binding1 = VcdFunctions.getNsxtNetworkDhcpBinding(GetNsxtNetworkDhcpBindingArgs.builder()
                .org("cloud")
                .orgNetworkId(pools.applyValue(getNsxtNetworkDhcpResult -> getNsxtNetworkDhcpResult.id()))
                .name("Binding-one")
                .build());
    
        }
    }
    
    variables:
      pools:
        fn::invoke:
          function: vcd:getNsxtNetworkDhcp
          arguments:
            org: cloud
            orgNetworkId: ${data.vcd_network_routed_v2.parent.id}
      binding1:
        fn::invoke:
          function: vcd:getNsxtNetworkDhcpBinding
          arguments:
            org: cloud
            orgNetworkId: ${pools.id}
            name: Binding-one
    

    Using getNsxtNetworkDhcpBinding

    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 getNsxtNetworkDhcpBinding(args: GetNsxtNetworkDhcpBindingArgs, opts?: InvokeOptions): Promise<GetNsxtNetworkDhcpBindingResult>
    function getNsxtNetworkDhcpBindingOutput(args: GetNsxtNetworkDhcpBindingOutputArgs, opts?: InvokeOptions): Output<GetNsxtNetworkDhcpBindingResult>
    def get_nsxt_network_dhcp_binding(id: Optional[str] = None,
                                      name: Optional[str] = None,
                                      org: Optional[str] = None,
                                      org_network_id: Optional[str] = None,
                                      opts: Optional[InvokeOptions] = None) -> GetNsxtNetworkDhcpBindingResult
    def get_nsxt_network_dhcp_binding_output(id: Optional[pulumi.Input[str]] = None,
                                      name: Optional[pulumi.Input[str]] = None,
                                      org: Optional[pulumi.Input[str]] = None,
                                      org_network_id: Optional[pulumi.Input[str]] = None,
                                      opts: Optional[InvokeOptions] = None) -> Output[GetNsxtNetworkDhcpBindingResult]
    func LookupNsxtNetworkDhcpBinding(ctx *Context, args *LookupNsxtNetworkDhcpBindingArgs, opts ...InvokeOption) (*LookupNsxtNetworkDhcpBindingResult, error)
    func LookupNsxtNetworkDhcpBindingOutput(ctx *Context, args *LookupNsxtNetworkDhcpBindingOutputArgs, opts ...InvokeOption) LookupNsxtNetworkDhcpBindingResultOutput

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

    public static class GetNsxtNetworkDhcpBinding 
    {
        public static Task<GetNsxtNetworkDhcpBindingResult> InvokeAsync(GetNsxtNetworkDhcpBindingArgs args, InvokeOptions? opts = null)
        public static Output<GetNsxtNetworkDhcpBindingResult> Invoke(GetNsxtNetworkDhcpBindingInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetNsxtNetworkDhcpBindingResult> getNsxtNetworkDhcpBinding(GetNsxtNetworkDhcpBindingArgs args, InvokeOptions options)
    public static Output<GetNsxtNetworkDhcpBindingResult> getNsxtNetworkDhcpBinding(GetNsxtNetworkDhcpBindingArgs args, InvokeOptions options)
    
    fn::invoke:
      function: vcd:index/getNsxtNetworkDhcpBinding:getNsxtNetworkDhcpBinding
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Name string
    A name of DHCP binding
    OrgNetworkId string
    The ID of an Org VDC network. Note .id field of vcd.NetworkIsolatedV2, vcd.NetworkRoutedV2 or vcd.NsxtNetworkDhcp can be referenced here
    Id string
    Org string
    The name of organization. Optional if defined at provider level
    Name string
    A name of DHCP binding
    OrgNetworkId string
    The ID of an Org VDC network. Note .id field of vcd.NetworkIsolatedV2, vcd.NetworkRoutedV2 or vcd.NsxtNetworkDhcp can be referenced here
    Id string
    Org string
    The name of organization. Optional if defined at provider level
    name String
    A name of DHCP binding
    orgNetworkId String
    The ID of an Org VDC network. Note .id field of vcd.NetworkIsolatedV2, vcd.NetworkRoutedV2 or vcd.NsxtNetworkDhcp can be referenced here
    id String
    org String
    The name of organization. Optional if defined at provider level
    name string
    A name of DHCP binding
    orgNetworkId string
    The ID of an Org VDC network. Note .id field of vcd.NetworkIsolatedV2, vcd.NetworkRoutedV2 or vcd.NsxtNetworkDhcp can be referenced here
    id string
    org string
    The name of organization. Optional if defined at provider level
    name str
    A name of DHCP binding
    org_network_id str
    The ID of an Org VDC network. Note .id field of vcd.NetworkIsolatedV2, vcd.NetworkRoutedV2 or vcd.NsxtNetworkDhcp can be referenced here
    id str
    org str
    The name of organization. Optional if defined at provider level
    name String
    A name of DHCP binding
    orgNetworkId String
    The ID of an Org VDC network. Note .id field of vcd.NetworkIsolatedV2, vcd.NetworkRoutedV2 or vcd.NsxtNetworkDhcp can be referenced here
    id String
    org String
    The name of organization. Optional if defined at provider level

    getNsxtNetworkDhcpBinding Result

    The following output properties are available:

    Supporting Types

    GetNsxtNetworkDhcpBindingDhcpV4Config

    GetNsxtNetworkDhcpBindingDhcpV6Config

    DnsServers List<string>
    SntpServers List<string>
    DnsServers []string
    SntpServers []string
    dnsServers List<String>
    sntpServers List<String>
    dnsServers string[]
    sntpServers string[]
    dns_servers Sequence[str]
    sntp_servers Sequence[str]
    dnsServers List<String>
    sntpServers List<String>

    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