1. Packages
  2. Packages
  3. Nsxt Provider
  4. API Docs
  5. getPolicyNetworkSpan
Viewing docs for nsxt 3.12.0
published on Monday, May 18, 2026 by vmware
Viewing docs for nsxt 3.12.0
published on Monday, May 18, 2026 by vmware

    This data source provides information about policy network span configured on NSX.

    This data source is applicable to NSX Policy Manager and is supported with NSX 9.1.0 onwards.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as nsxt from "@pulumi/nsxt";
    
    const netspan = nsxt.getPolicyNetworkSpan({
        displayName: "ns1",
    });
    
    import pulumi
    import pulumi_nsxt as nsxt
    
    netspan = nsxt.get_policy_network_span(display_name="ns1")
    
    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.LookupPolicyNetworkSpan(ctx, &nsxt.LookupPolicyNetworkSpanArgs{
    			DisplayName: pulumi.StringRef("ns1"),
    		}, 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 netspan = Nsxt.GetPolicyNetworkSpan.Invoke(new()
        {
            DisplayName = "ns1",
        });
    
    });
    
    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.GetPolicyNetworkSpanArgs;
    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 netspan = NsxtFunctions.getPolicyNetworkSpan(GetPolicyNetworkSpanArgs.builder()
                .displayName("ns1")
                .build());
    
        }
    }
    
    variables:
      netspan:
        fn::invoke:
          function: nsxt:getPolicyNetworkSpan
          arguments:
            displayName: ns1
    
    Example coming soon!
    

    Fetching Default Network Span Attribute

    import * as pulumi from "@pulumi/pulumi";
    import * as nsxt from "@pulumi/nsxt";
    
    const test = nsxt.getPolicyNetworkSpan({
        isDefault: true,
    });
    export const nsxtPolicyNetworkSpanTest = test.then(test => test.displayName);
    
    import pulumi
    import pulumi_nsxt as nsxt
    
    test = nsxt.get_policy_network_span(is_default=True)
    pulumi.export("nsxtPolicyNetworkSpanTest", test.display_name)
    
    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 {
    		test, err := nsxt.LookupPolicyNetworkSpan(ctx, &nsxt.LookupPolicyNetworkSpanArgs{
    			IsDefault: pulumi.BoolRef(true),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("nsxtPolicyNetworkSpanTest", test.DisplayName)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Nsxt = Pulumi.Nsxt;
    
    return await Deployment.RunAsync(() => 
    {
        var test = Nsxt.GetPolicyNetworkSpan.Invoke(new()
        {
            IsDefault = true,
        });
    
        return new Dictionary<string, object?>
        {
            ["nsxtPolicyNetworkSpanTest"] = test.Apply(getPolicyNetworkSpanResult => getPolicyNetworkSpanResult.DisplayName),
        };
    });
    
    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.GetPolicyNetworkSpanArgs;
    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 = NsxtFunctions.getPolicyNetworkSpan(GetPolicyNetworkSpanArgs.builder()
                .isDefault(true)
                .build());
    
            ctx.export("nsxtPolicyNetworkSpanTest", test.displayName());
        }
    }
    
    variables:
      test:
        fn::invoke:
          function: nsxt:getPolicyNetworkSpan
          arguments:
            isDefault: true
    outputs:
      nsxtPolicyNetworkSpanTest: ${test.displayName}
    
    Example coming soon!
    

    Using getPolicyNetworkSpan

    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 getPolicyNetworkSpan(args: GetPolicyNetworkSpanArgs, opts?: InvokeOptions): Promise<GetPolicyNetworkSpanResult>
    function getPolicyNetworkSpanOutput(args: GetPolicyNetworkSpanOutputArgs, opts?: InvokeOptions): Output<GetPolicyNetworkSpanResult>
    def get_policy_network_span(description: Optional[str] = None,
                                display_name: Optional[str] = None,
                                id: Optional[str] = None,
                                is_default: Optional[bool] = None,
                                opts: Optional[InvokeOptions] = None) -> GetPolicyNetworkSpanResult
    def get_policy_network_span_output(description: pulumi.Input[Optional[str]] = None,
                                display_name: pulumi.Input[Optional[str]] = None,
                                id: pulumi.Input[Optional[str]] = None,
                                is_default: pulumi.Input[Optional[bool]] = None,
                                opts: Optional[InvokeOptions] = None) -> Output[GetPolicyNetworkSpanResult]
    func LookupPolicyNetworkSpan(ctx *Context, args *LookupPolicyNetworkSpanArgs, opts ...InvokeOption) (*LookupPolicyNetworkSpanResult, error)
    func LookupPolicyNetworkSpanOutput(ctx *Context, args *LookupPolicyNetworkSpanOutputArgs, opts ...InvokeOption) LookupPolicyNetworkSpanResultOutput

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

    public static class GetPolicyNetworkSpan 
    {
        public static Task<GetPolicyNetworkSpanResult> InvokeAsync(GetPolicyNetworkSpanArgs args, InvokeOptions? opts = null)
        public static Output<GetPolicyNetworkSpanResult> Invoke(GetPolicyNetworkSpanInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetPolicyNetworkSpanResult> getPolicyNetworkSpan(GetPolicyNetworkSpanArgs args, InvokeOptions options)
    public static Output<GetPolicyNetworkSpanResult> getPolicyNetworkSpan(GetPolicyNetworkSpanArgs args, InvokeOptions options)
    
    fn::invoke:
      function: nsxt:index/getPolicyNetworkSpan:getPolicyNetworkSpan
      arguments:
        # arguments dictionary
    data "nsxt_getpolicynetworkspan" "name" {
        # arguments
    }

    The following arguments are supported:

    Description string
    The description of the resource.
    DisplayName string
    The Display Name prefix of the network span to retrieve.
    Id string
    The ID of the network span to retrieve.
    IsDefault bool
    Specifies if the Network Span is set as the default.
    Description string
    The description of the resource.
    DisplayName string
    The Display Name prefix of the network span to retrieve.
    Id string
    The ID of the network span to retrieve.
    IsDefault bool
    Specifies if the Network Span is set as the default.
    description string
    The description of the resource.
    display_name string
    The Display Name prefix of the network span to retrieve.
    id string
    The ID of the network span to retrieve.
    is_default bool
    Specifies if the Network Span is set as the default.
    description String
    The description of the resource.
    displayName String
    The Display Name prefix of the network span to retrieve.
    id String
    The ID of the network span to retrieve.
    isDefault Boolean
    Specifies if the Network Span is set as the default.
    description string
    The description of the resource.
    displayName string
    The Display Name prefix of the network span to retrieve.
    id string
    The ID of the network span to retrieve.
    isDefault boolean
    Specifies if the Network Span is set as the default.
    description str
    The description of the resource.
    display_name str
    The Display Name prefix of the network span to retrieve.
    id str
    The ID of the network span to retrieve.
    is_default bool
    Specifies if the Network Span is set as the default.
    description String
    The description of the resource.
    displayName String
    The Display Name prefix of the network span to retrieve.
    id String
    The ID of the network span to retrieve.
    isDefault Boolean
    Specifies if the Network Span is set as the default.

    getPolicyNetworkSpan Result

    The following output properties are available:

    Description string
    The description of the resource.
    DisplayName string
    Id string
    Path string
    The NSX path of the policy resource.
    IsDefault bool
    Specifies if the Network Span is set as the default.
    Description string
    The description of the resource.
    DisplayName string
    Id string
    Path string
    The NSX path of the policy resource.
    IsDefault bool
    Specifies if the Network Span is set as the default.
    description string
    The description of the resource.
    display_name string
    id string
    path string
    The NSX path of the policy resource.
    is_default bool
    Specifies if the Network Span is set as the default.
    description String
    The description of the resource.
    displayName String
    id String
    path String
    The NSX path of the policy resource.
    isDefault Boolean
    Specifies if the Network Span is set as the default.
    description string
    The description of the resource.
    displayName string
    id string
    path string
    The NSX path of the policy resource.
    isDefault boolean
    Specifies if the Network Span is set as the default.
    description str
    The description of the resource.
    display_name str
    id str
    path str
    The NSX path of the policy resource.
    is_default bool
    Specifies if the Network Span is set as the default.
    description String
    The description of the resource.
    displayName String
    id String
    path String
    The NSX path of the policy resource.
    isDefault Boolean
    Specifies if the Network Span is set as the default.

    Package Details

    Repository
    nsxt vmware/terraform-provider-nsxt
    License
    Notes
    This Pulumi package is based on the nsxt Terraform Provider.
    Viewing docs for nsxt 3.12.0
    published on Monday, May 18, 2026 by vmware

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial