1. Packages
  2. Nsxt Provider
  3. API Docs
  4. getPolicyTransportZone
nsxt 3.8.1 published on Wednesday, Apr 30, 2025 by vmware

nsxt.getPolicyTransportZone

Explore with Pulumi AI

nsxt logo
nsxt 3.8.1 published on Wednesday, Apr 30, 2025 by vmware

    This data source provides information about Policy based Transport Zones (TZ) configured in NSX. A Transport Zone defines the scope to which a network can extend in NSX. For example an overlay based Transport Zone is associated with both hypervisors and logical switches and defines which hypervisors will be able to serve the defined logical switch. Virtual machines on the hypervisor associated with a Transport Zone can be attached to logical switches in that same Transport Zone.

    This data source is applicable to NSX Global Manager, NSX Policy Manager and VMC.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as nsxt from "@pulumi/nsxt";
    
    const overlayTransportZone = nsxt.getPolicyTransportZone({
        displayName: "1-transportzone-87",
    });
    
    import pulumi
    import pulumi_nsxt as nsxt
    
    overlay_transport_zone = nsxt.get_policy_transport_zone(display_name="1-transportzone-87")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/nsxt/v3/nsxt"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := nsxt.LookupPolicyTransportZone(ctx, &nsxt.LookupPolicyTransportZoneArgs{
    			DisplayName: pulumi.StringRef("1-transportzone-87"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Nsxt = Pulumi.Nsxt;
    
    return await Deployment.RunAsync(() => 
    {
        var overlayTransportZone = Nsxt.GetPolicyTransportZone.Invoke(new()
        {
            DisplayName = "1-transportzone-87",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.nsxt.NsxtFunctions;
    import com.pulumi.nsxt.inputs.GetPolicyTransportZoneArgs;
    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 overlayTransportZone = NsxtFunctions.getPolicyTransportZone(GetPolicyTransportZoneArgs.builder()
                .displayName("1-transportzone-87")
                .build());
    
        }
    }
    
    variables:
      overlayTransportZone:
        fn::invoke:
          function: nsxt:getPolicyTransportZone
          arguments:
            displayName: 1-transportzone-87
    
    import * as pulumi from "@pulumi/pulumi";
    import * as nsxt from "@pulumi/nsxt";
    
    const vlanTransportZone = nsxt.getPolicyTransportZone({
        isDefault: true,
        transportType: "VLAN_BACKED",
    });
    
    import pulumi
    import pulumi_nsxt as nsxt
    
    vlan_transport_zone = nsxt.get_policy_transport_zone(is_default=True,
        transport_type="VLAN_BACKED")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/nsxt/v3/nsxt"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := nsxt.LookupPolicyTransportZone(ctx, &nsxt.LookupPolicyTransportZoneArgs{
    			IsDefault:     pulumi.BoolRef(true),
    			TransportType: pulumi.StringRef("VLAN_BACKED"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Nsxt = Pulumi.Nsxt;
    
    return await Deployment.RunAsync(() => 
    {
        var vlanTransportZone = Nsxt.GetPolicyTransportZone.Invoke(new()
        {
            IsDefault = true,
            TransportType = "VLAN_BACKED",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.nsxt.NsxtFunctions;
    import com.pulumi.nsxt.inputs.GetPolicyTransportZoneArgs;
    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 vlanTransportZone = NsxtFunctions.getPolicyTransportZone(GetPolicyTransportZoneArgs.builder()
                .isDefault(true)
                .transportType("VLAN_BACKED")
                .build());
    
        }
    }
    
    variables:
      vlanTransportZone:
        fn::invoke:
          function: nsxt:getPolicyTransportZone
          arguments:
            isDefault: true
            transportType: VLAN_BACKED
    

    Note: This usage is for Global Manager only.

    import * as pulumi from "@pulumi/pulumi";
    import * as nsxt from "@pulumi/nsxt";
    
    const paris = nsxt.getPolicySite({
        displayName: "Paris",
    });
    const overlayTransportZone = paris.then(paris => nsxt.getPolicyTransportZone({
        displayName: "1-transportzone-87",
        sitePath: paris.path,
    }));
    
    import pulumi
    import pulumi_nsxt as nsxt
    
    paris = nsxt.get_policy_site(display_name="Paris")
    overlay_transport_zone = nsxt.get_policy_transport_zone(display_name="1-transportzone-87",
        site_path=paris.path)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/nsxt/v3/nsxt"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		paris, err := nsxt.LookupPolicySite(ctx, &nsxt.LookupPolicySiteArgs{
    			DisplayName: pulumi.StringRef("Paris"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = nsxt.LookupPolicyTransportZone(ctx, &nsxt.LookupPolicyTransportZoneArgs{
    			DisplayName: pulumi.StringRef("1-transportzone-87"),
    			SitePath:    pulumi.StringRef(paris.Path),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Nsxt = Pulumi.Nsxt;
    
    return await Deployment.RunAsync(() => 
    {
        var paris = Nsxt.GetPolicySite.Invoke(new()
        {
            DisplayName = "Paris",
        });
    
        var overlayTransportZone = Nsxt.GetPolicyTransportZone.Invoke(new()
        {
            DisplayName = "1-transportzone-87",
            SitePath = paris.Apply(getPolicySiteResult => getPolicySiteResult.Path),
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.nsxt.NsxtFunctions;
    import com.pulumi.nsxt.inputs.GetPolicySiteArgs;
    import com.pulumi.nsxt.inputs.GetPolicyTransportZoneArgs;
    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 paris = NsxtFunctions.getPolicySite(GetPolicySiteArgs.builder()
                .displayName("Paris")
                .build());
    
            final var overlayTransportZone = NsxtFunctions.getPolicyTransportZone(GetPolicyTransportZoneArgs.builder()
                .displayName("1-transportzone-87")
                .sitePath(paris.applyValue(getPolicySiteResult -> getPolicySiteResult.path()))
                .build());
    
        }
    }
    
    variables:
      paris:
        fn::invoke:
          function: nsxt:getPolicySite
          arguments:
            displayName: Paris
      overlayTransportZone:
        fn::invoke:
          function: nsxt:getPolicyTransportZone
          arguments:
            displayName: 1-transportzone-87
            sitePath: ${paris.path}
    

    Using getPolicyTransportZone

    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 getPolicyTransportZone(args: GetPolicyTransportZoneArgs, opts?: InvokeOptions): Promise<GetPolicyTransportZoneResult>
    function getPolicyTransportZoneOutput(args: GetPolicyTransportZoneOutputArgs, opts?: InvokeOptions): Output<GetPolicyTransportZoneResult>
    def get_policy_transport_zone(description: Optional[str] = None,
                                  display_name: Optional[str] = None,
                                  id: Optional[str] = None,
                                  is_default: Optional[bool] = None,
                                  site_path: Optional[str] = None,
                                  transport_type: Optional[str] = None,
                                  opts: Optional[InvokeOptions] = None) -> GetPolicyTransportZoneResult
    def get_policy_transport_zone_output(description: Optional[pulumi.Input[str]] = None,
                                  display_name: Optional[pulumi.Input[str]] = None,
                                  id: Optional[pulumi.Input[str]] = None,
                                  is_default: Optional[pulumi.Input[bool]] = None,
                                  site_path: Optional[pulumi.Input[str]] = None,
                                  transport_type: Optional[pulumi.Input[str]] = None,
                                  opts: Optional[InvokeOptions] = None) -> Output[GetPolicyTransportZoneResult]
    func LookupPolicyTransportZone(ctx *Context, args *LookupPolicyTransportZoneArgs, opts ...InvokeOption) (*LookupPolicyTransportZoneResult, error)
    func LookupPolicyTransportZoneOutput(ctx *Context, args *LookupPolicyTransportZoneOutputArgs, opts ...InvokeOption) LookupPolicyTransportZoneResultOutput

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

    public static class GetPolicyTransportZone 
    {
        public static Task<GetPolicyTransportZoneResult> InvokeAsync(GetPolicyTransportZoneArgs args, InvokeOptions? opts = null)
        public static Output<GetPolicyTransportZoneResult> Invoke(GetPolicyTransportZoneInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetPolicyTransportZoneResult> getPolicyTransportZone(GetPolicyTransportZoneArgs args, InvokeOptions options)
    public static Output<GetPolicyTransportZoneResult> getPolicyTransportZone(GetPolicyTransportZoneArgs args, InvokeOptions options)
    
    fn::invoke:
      function: nsxt:index/getPolicyTransportZone:getPolicyTransportZone
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Description string
    The description of the Transport Zone.
    DisplayName string
    The Display Name prefix of the Transport Zone to retrieve.
    Id string
    The ID of Transport Zone to retrieve.
    IsDefault bool
    May be set together with transport_type in order to retrieve default Transport Zone for this transport type.
    SitePath string
    The path of the site which the Transport Zone belongs to, this configuration is required for global manager only. path field of the existing nsxt.PolicySite can be used here.
    TransportType string
    Transport type of requested Transport Zone, one of OVERLAY_STANDARD, OVERLAY_ENS, OVERLAY_BACKED, VLAN_BACKED and UNKNOWN.
    Description string
    The description of the Transport Zone.
    DisplayName string
    The Display Name prefix of the Transport Zone to retrieve.
    Id string
    The ID of Transport Zone to retrieve.
    IsDefault bool
    May be set together with transport_type in order to retrieve default Transport Zone for this transport type.
    SitePath string
    The path of the site which the Transport Zone belongs to, this configuration is required for global manager only. path field of the existing nsxt.PolicySite can be used here.
    TransportType string
    Transport type of requested Transport Zone, one of OVERLAY_STANDARD, OVERLAY_ENS, OVERLAY_BACKED, VLAN_BACKED and UNKNOWN.
    description String
    The description of the Transport Zone.
    displayName String
    The Display Name prefix of the Transport Zone to retrieve.
    id String
    The ID of Transport Zone to retrieve.
    isDefault Boolean
    May be set together with transport_type in order to retrieve default Transport Zone for this transport type.
    sitePath String
    The path of the site which the Transport Zone belongs to, this configuration is required for global manager only. path field of the existing nsxt.PolicySite can be used here.
    transportType String
    Transport type of requested Transport Zone, one of OVERLAY_STANDARD, OVERLAY_ENS, OVERLAY_BACKED, VLAN_BACKED and UNKNOWN.
    description string
    The description of the Transport Zone.
    displayName string
    The Display Name prefix of the Transport Zone to retrieve.
    id string
    The ID of Transport Zone to retrieve.
    isDefault boolean
    May be set together with transport_type in order to retrieve default Transport Zone for this transport type.
    sitePath string
    The path of the site which the Transport Zone belongs to, this configuration is required for global manager only. path field of the existing nsxt.PolicySite can be used here.
    transportType string
    Transport type of requested Transport Zone, one of OVERLAY_STANDARD, OVERLAY_ENS, OVERLAY_BACKED, VLAN_BACKED and UNKNOWN.
    description str
    The description of the Transport Zone.
    display_name str
    The Display Name prefix of the Transport Zone to retrieve.
    id str
    The ID of Transport Zone to retrieve.
    is_default bool
    May be set together with transport_type in order to retrieve default Transport Zone for this transport type.
    site_path str
    The path of the site which the Transport Zone belongs to, this configuration is required for global manager only. path field of the existing nsxt.PolicySite can be used here.
    transport_type str
    Transport type of requested Transport Zone, one of OVERLAY_STANDARD, OVERLAY_ENS, OVERLAY_BACKED, VLAN_BACKED and UNKNOWN.
    description String
    The description of the Transport Zone.
    displayName String
    The Display Name prefix of the Transport Zone to retrieve.
    id String
    The ID of Transport Zone to retrieve.
    isDefault Boolean
    May be set together with transport_type in order to retrieve default Transport Zone for this transport type.
    sitePath String
    The path of the site which the Transport Zone belongs to, this configuration is required for global manager only. path field of the existing nsxt.PolicySite can be used here.
    transportType String
    Transport type of requested Transport Zone, one of OVERLAY_STANDARD, OVERLAY_ENS, OVERLAY_BACKED, VLAN_BACKED and UNKNOWN.

    getPolicyTransportZone Result

    The following output properties are available:

    Description string
    The description of the Transport Zone.
    DisplayName string
    Id string
    IsDefault bool
    A boolean flag indicating if this Transport Zone is the default.
    Path string
    The NSX path of the policy resource.
    RealizedId string
    The id of realized transport zone object. This id should be used in nsxt.EdgeTransportNode resource.
    TransportType string
    The transport type of this transport zone.
    SitePath string
    Description string
    The description of the Transport Zone.
    DisplayName string
    Id string
    IsDefault bool
    A boolean flag indicating if this Transport Zone is the default.
    Path string
    The NSX path of the policy resource.
    RealizedId string
    The id of realized transport zone object. This id should be used in nsxt.EdgeTransportNode resource.
    TransportType string
    The transport type of this transport zone.
    SitePath string
    description String
    The description of the Transport Zone.
    displayName String
    id String
    isDefault Boolean
    A boolean flag indicating if this Transport Zone is the default.
    path String
    The NSX path of the policy resource.
    realizedId String
    The id of realized transport zone object. This id should be used in nsxt.EdgeTransportNode resource.
    transportType String
    The transport type of this transport zone.
    sitePath String
    description string
    The description of the Transport Zone.
    displayName string
    id string
    isDefault boolean
    A boolean flag indicating if this Transport Zone is the default.
    path string
    The NSX path of the policy resource.
    realizedId string
    The id of realized transport zone object. This id should be used in nsxt.EdgeTransportNode resource.
    transportType string
    The transport type of this transport zone.
    sitePath string
    description str
    The description of the Transport Zone.
    display_name str
    id str
    is_default bool
    A boolean flag indicating if this Transport Zone is the default.
    path str
    The NSX path of the policy resource.
    realized_id str
    The id of realized transport zone object. This id should be used in nsxt.EdgeTransportNode resource.
    transport_type str
    The transport type of this transport zone.
    site_path str
    description String
    The description of the Transport Zone.
    displayName String
    id String
    isDefault Boolean
    A boolean flag indicating if this Transport Zone is the default.
    path String
    The NSX path of the policy resource.
    realizedId String
    The id of realized transport zone object. This id should be used in nsxt.EdgeTransportNode resource.
    transportType String
    The transport type of this transport zone.
    sitePath String

    Package Details

    Repository
    nsxt vmware/terraform-provider-nsxt
    License
    Notes
    This Pulumi package is based on the nsxt Terraform Provider.
    nsxt logo
    nsxt 3.8.1 published on Wednesday, Apr 30, 2025 by vmware