1. Registry
  2. Packages
  3. Nsxt Provider
  4. API Docs
  5. getPolicyBaremetalServerInterface
Viewing docs for nsxt 3.12.1
published on Friday, Sep 11, 2026 by vmware
Viewing docs for nsxt 3.12.1
published on Friday, Sep 11, 2026 by vmware

    This data source provides information about a single bare metal server interface from NSX inventory. Use either external_id (exact match) or display_name (exact match returning exactly one result).

    This data source is applicable to NSX Policy Manager and requires NSX-T version 9.0.0 or higher (Bare Metal Server support)

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as nsxt from "@pulumi/nsxt";
    
    // Find interface by external ID
    const baremetalinterface = nsxt.getPolicyBaremetalServerInterface({
        externalId: "71be0142-2ed1-1d53-9c60-02005b4b7246",
    });
    // Find interface by display name (must return exactly one result)
    const eth0 = nsxt.getPolicyBaremetalServerInterface({
        displayName: "eth0",
    });
    // Use interface information in other resources
    const interfaceTags = new nsxt.PolicyBaremetalServerInterfaceTags("interface_tags", {
        externalId: baremetalinterface.then(baremetalinterface => baremetalinterface.externalId),
        tags: [{
            scope: "network_role",
            tag: "data_plane",
        }],
    });
    export const interfaceIps = baremetalinterface.then(baremetalinterface => baremetalinterface.ipAddresses);
    
    import pulumi
    import pulumi_nsxt as nsxt
    
    # Find interface by external ID
    baremetalinterface = nsxt.get_policy_baremetal_server_interface(external_id="71be0142-2ed1-1d53-9c60-02005b4b7246")
    # Find interface by display name (must return exactly one result)
    eth0 = nsxt.get_policy_baremetal_server_interface(display_name="eth0")
    # Use interface information in other resources
    interface_tags = nsxt.PolicyBaremetalServerInterfaceTags("interface_tags",
        external_id=baremetalinterface.external_id,
        tags=[{
            "scope": "network_role",
            "tag": "data_plane",
        }])
    pulumi.export("interfaceIps", baremetalinterface.ip_addresses)
    
    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 {
    		// Find interface by external ID
    		baremetalinterface, err := nsxt.GetPolicyBaremetalServerInterface(ctx, &nsxt.GetPolicyBaremetalServerInterfaceArgs{
    			ExternalId: pulumi.StringRef("71be0142-2ed1-1d53-9c60-02005b4b7246"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		// Find interface by display name (must return exactly one result)
    		_, err = nsxt.GetPolicyBaremetalServerInterface(ctx, &nsxt.GetPolicyBaremetalServerInterfaceArgs{
    			DisplayName: pulumi.StringRef("eth0"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		// Use interface information in other resources
    		_, err = nsxt.NewPolicyBaremetalServerInterfaceTags(ctx, "interface_tags", &nsxt.PolicyBaremetalServerInterfaceTagsArgs{
    			ExternalId: pulumi.String(baremetalinterface.ExternalId),
    			Tags: nsxt.PolicyBaremetalServerInterfaceTagsTagArray{
    				&nsxt.PolicyBaremetalServerInterfaceTagsTagArgs{
    					Scope: pulumi.String("network_role"),
    					Tag:   pulumi.String("data_plane"),
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		ctx.Export("interfaceIps", baremetalinterface.IpAddresses)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Nsxt = Pulumi.Nsxt;
    
    return await Deployment.RunAsync(() => 
    {
        // Find interface by external ID
        var baremetalinterface = Nsxt.GetPolicyBaremetalServerInterface.Invoke(new()
        {
            ExternalId = "71be0142-2ed1-1d53-9c60-02005b4b7246",
        });
    
        // Find interface by display name (must return exactly one result)
        var eth0 = Nsxt.GetPolicyBaremetalServerInterface.Invoke(new()
        {
            DisplayName = "eth0",
        });
    
        // Use interface information in other resources
        var interfaceTags = new Nsxt.PolicyBaremetalServerInterfaceTags("interface_tags", new()
        {
            ExternalId = baremetalinterface.Apply(getPolicyBaremetalServerInterfaceResult => getPolicyBaremetalServerInterfaceResult.ExternalId),
            Tags = new[]
            {
                new Nsxt.Inputs.PolicyBaremetalServerInterfaceTagsTagArgs
                {
                    Scope = "network_role",
                    Tag = "data_plane",
                },
            },
        });
    
        return new Dictionary<string, object?>
        {
            ["interfaceIps"] = baremetalinterface.Apply(getPolicyBaremetalServerInterfaceResult => getPolicyBaremetalServerInterfaceResult.IpAddresses),
        };
    });
    
    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.GetPolicyBaremetalServerInterfaceArgs;
    import com.pulumi.nsxt.PolicyBaremetalServerInterfaceTags;
    import com.pulumi.nsxt.PolicyBaremetalServerInterfaceTagsArgs;
    import com.pulumi.nsxt.inputs.PolicyBaremetalServerInterfaceTagsTagArgs;
    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) {
            // Find interface by external ID
            final var baremetalinterface = NsxtFunctions.getPolicyBaremetalServerInterface(GetPolicyBaremetalServerInterfaceArgs.builder()
                .externalId("71be0142-2ed1-1d53-9c60-02005b4b7246")
                .build());
    
            // Find interface by display name (must return exactly one result)
            final var eth0 = NsxtFunctions.getPolicyBaremetalServerInterface(GetPolicyBaremetalServerInterfaceArgs.builder()
                .displayName("eth0")
                .build());
    
            // Use interface information in other resources
            var interfaceTags = new PolicyBaremetalServerInterfaceTags("interfaceTags", PolicyBaremetalServerInterfaceTagsArgs.builder()
                .externalId(baremetalinterface.externalId())
                .tags(PolicyBaremetalServerInterfaceTagsTagArgs.builder()
                    .scope("network_role")
                    .tag("data_plane")
                    .build())
                .build());
    
            ctx.export("interfaceIps", baremetalinterface.ipAddresses());
        }
    }
    
    resources:
      # Use interface information in other resources
      interfaceTags:
        type: nsxt:PolicyBaremetalServerInterfaceTags
        name: interface_tags
        properties:
          externalId: ${baremetalinterface.externalId}
          tags:
            - scope: network_role
              tag: data_plane
    variables:
      # Find interface by external ID
      baremetalinterface:
        fn::invoke:
          function: nsxt:getPolicyBaremetalServerInterface
          arguments:
            externalId: 71be0142-2ed1-1d53-9c60-02005b4b7246
      # Find interface by display name (must return exactly one result)
      eth0:
        fn::invoke:
          function: nsxt:getPolicyBaremetalServerInterface
          arguments:
            displayName: eth0
    outputs:
      interfaceIps: ${baremetalinterface.ipAddresses}
    
    Example coming soon!
    

    Using getPolicyBaremetalServerInterface

    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 getPolicyBaremetalServerInterface(args: GetPolicyBaremetalServerInterfaceArgs, opts?: InvokeOptions): Promise<GetPolicyBaremetalServerInterfaceResult>
    function getPolicyBaremetalServerInterfaceOutput(args: GetPolicyBaremetalServerInterfaceOutputArgs, opts?: InvokeOutputOptions): Output<GetPolicyBaremetalServerInterfaceResult>
    def get_policy_baremetal_server_interface(display_name: Optional[str] = None,
                                              external_id: Optional[str] = None,
                                              id: Optional[str] = None,
                                              opts: Optional[InvokeOptions] = None) -> GetPolicyBaremetalServerInterfaceResult
    def get_policy_baremetal_server_interface_output(display_name: pulumi.Input[Optional[str]] = None,
                                              external_id: pulumi.Input[Optional[str]] = None,
                                              id: pulumi.Input[Optional[str]] = None,
                                              opts: Optional[InvokeOutputOptions] = None) -> Output[GetPolicyBaremetalServerInterfaceResult]
    func GetPolicyBaremetalServerInterface(ctx *Context, args *GetPolicyBaremetalServerInterfaceArgs, opts ...InvokeOption) (*GetPolicyBaremetalServerInterfaceResult, error)
    func GetPolicyBaremetalServerInterfaceOutput(ctx *Context, args *GetPolicyBaremetalServerInterfaceOutputArgs, opts ...InvokeOption) GetPolicyBaremetalServerInterfaceResultOutput

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

    public static class GetPolicyBaremetalServerInterface 
    {
        public static Task<GetPolicyBaremetalServerInterfaceResult> InvokeAsync(GetPolicyBaremetalServerInterfaceArgs args, InvokeOptions? opts = null)
        public static Output<GetPolicyBaremetalServerInterfaceResult> Invoke(GetPolicyBaremetalServerInterfaceInvokeArgs args, InvokeOptions? opts = null)
        public static Output<GetPolicyBaremetalServerInterfaceResult> Invoke(GetPolicyBaremetalServerInterfaceInvokeArgs args, InvokeOutputOptions opts)
    }
    public static CompletableFuture<GetPolicyBaremetalServerInterfaceResult> getPolicyBaremetalServerInterface(GetPolicyBaremetalServerInterfaceArgs args, InvokeOptions options)
    public static Output<GetPolicyBaremetalServerInterfaceResult> getPolicyBaremetalServerInterface(GetPolicyBaremetalServerInterfaceArgs args, InvokeOptions options)
    public static Output<GetPolicyBaremetalServerInterfaceResult> getPolicyBaremetalServerInterface(GetPolicyBaremetalServerInterfaceArgs args, InvokeOutputOptions options)
    
    fn::invoke:
      function: nsxt:index/getPolicyBaremetalServerInterface:getPolicyBaremetalServerInterface
      arguments:
        # arguments dictionary
    data "nsxt_get_policy_baremetal_server_interface" "name" {
        # arguments
    }

    The following arguments are supported:

    DisplayName string

    Display name of the bare metal server interface for exact match lookup. Default is empty (must specify either external_id or display_name).

    Note: Either external_id or display_name must be specified. If using display_name, exactly one interface must match.

    ExternalId string
    External ID of the bare metal server interface for exact match lookup. Default is empty (must specify either external_id or display_name).
    Id string
    ID of the data source.
    DisplayName string

    Display name of the bare metal server interface for exact match lookup. Default is empty (must specify either external_id or display_name).

    Note: Either external_id or display_name must be specified. If using display_name, exactly one interface must match.

    ExternalId string
    External ID of the bare metal server interface for exact match lookup. Default is empty (must specify either external_id or display_name).
    Id string
    ID of the data source.
    display_name string

    Display name of the bare metal server interface for exact match lookup. Default is empty (must specify either external_id or display_name).

    Note: Either external_id or display_name must be specified. If using display_name, exactly one interface must match.

    external_id string
    External ID of the bare metal server interface for exact match lookup. Default is empty (must specify either external_id or display_name).
    id string
    ID of the data source.
    displayName String

    Display name of the bare metal server interface for exact match lookup. Default is empty (must specify either external_id or display_name).

    Note: Either external_id or display_name must be specified. If using display_name, exactly one interface must match.

    externalId String
    External ID of the bare metal server interface for exact match lookup. Default is empty (must specify either external_id or display_name).
    id String
    ID of the data source.
    displayName string

    Display name of the bare metal server interface for exact match lookup. Default is empty (must specify either external_id or display_name).

    Note: Either external_id or display_name must be specified. If using display_name, exactly one interface must match.

    externalId string
    External ID of the bare metal server interface for exact match lookup. Default is empty (must specify either external_id or display_name).
    id string
    ID of the data source.
    display_name str

    Display name of the bare metal server interface for exact match lookup. Default is empty (must specify either external_id or display_name).

    Note: Either external_id or display_name must be specified. If using display_name, exactly one interface must match.

    external_id str
    External ID of the bare metal server interface for exact match lookup. Default is empty (must specify either external_id or display_name).
    id str
    ID of the data source.
    displayName String

    Display name of the bare metal server interface for exact match lookup. Default is empty (must specify either external_id or display_name).

    Note: Either external_id or display_name must be specified. If using display_name, exactly one interface must match.

    externalId String
    External ID of the bare metal server interface for exact match lookup. Default is empty (must specify either external_id or display_name).
    id String
    ID of the data source.

    getPolicyBaremetalServerInterface Result

    The following output properties are available:

    BmsExternalId string
    External ID of the parent bare metal server.
    Id string
    ID of the data source.
    IpAddresses List<string>
    List of IP addresses assigned to the interface.
    IsMgmtInterface bool
    Whether this is a management interface.
    LastSyncTime double
    Last synchronization time.
    ResourceType string
    Resource type.
    SourceId string
    Source ID of the bare metal server interface.
    State string
    State of the interface (UP, DOWN, etc.).
    Tags List<GetPolicyBaremetalServerInterfaceTag>
    List of tags applied to the interface. Each tag contains:
    DisplayName string
    ExternalId string
    BmsExternalId string
    External ID of the parent bare metal server.
    Id string
    ID of the data source.
    IpAddresses []string
    List of IP addresses assigned to the interface.
    IsMgmtInterface bool
    Whether this is a management interface.
    LastSyncTime float64
    Last synchronization time.
    ResourceType string
    Resource type.
    SourceId string
    Source ID of the bare metal server interface.
    State string
    State of the interface (UP, DOWN, etc.).
    Tags []GetPolicyBaremetalServerInterfaceTag
    List of tags applied to the interface. Each tag contains:
    DisplayName string
    ExternalId string
    bms_external_id string
    External ID of the parent bare metal server.
    id string
    ID of the data source.
    ip_addresses list(string)
    List of IP addresses assigned to the interface.
    is_mgmt_interface bool
    Whether this is a management interface.
    last_sync_time number
    Last synchronization time.
    resource_type string
    Resource type.
    source_id string
    Source ID of the bare metal server interface.
    state string
    State of the interface (UP, DOWN, etc.).
    tags list(object)
    List of tags applied to the interface. Each tag contains:
    display_name string
    external_id string
    bmsExternalId String
    External ID of the parent bare metal server.
    id String
    ID of the data source.
    ipAddresses List<String>
    List of IP addresses assigned to the interface.
    isMgmtInterface Boolean
    Whether this is a management interface.
    lastSyncTime Double
    Last synchronization time.
    resourceType String
    Resource type.
    sourceId String
    Source ID of the bare metal server interface.
    state String
    State of the interface (UP, DOWN, etc.).
    tags List<GetPolicyBaremetalServerInterfaceTag>
    List of tags applied to the interface. Each tag contains:
    displayName String
    externalId String
    bmsExternalId string
    External ID of the parent bare metal server.
    id string
    ID of the data source.
    ipAddresses string[]
    List of IP addresses assigned to the interface.
    isMgmtInterface boolean
    Whether this is a management interface.
    lastSyncTime number
    Last synchronization time.
    resourceType string
    Resource type.
    sourceId string
    Source ID of the bare metal server interface.
    state string
    State of the interface (UP, DOWN, etc.).
    tags GetPolicyBaremetalServerInterfaceTag[]
    List of tags applied to the interface. Each tag contains:
    displayName string
    externalId string
    bms_external_id str
    External ID of the parent bare metal server.
    id str
    ID of the data source.
    ip_addresses Sequence[str]
    List of IP addresses assigned to the interface.
    is_mgmt_interface bool
    Whether this is a management interface.
    last_sync_time float
    Last synchronization time.
    resource_type str
    Resource type.
    source_id str
    Source ID of the bare metal server interface.
    state str
    State of the interface (UP, DOWN, etc.).
    tags Sequence[GetPolicyBaremetalServerInterfaceTag]
    List of tags applied to the interface. Each tag contains:
    display_name str
    external_id str
    bmsExternalId String
    External ID of the parent bare metal server.
    id String
    ID of the data source.
    ipAddresses List<String>
    List of IP addresses assigned to the interface.
    isMgmtInterface Boolean
    Whether this is a management interface.
    lastSyncTime Number
    Last synchronization time.
    resourceType String
    Resource type.
    sourceId String
    Source ID of the bare metal server interface.
    state String
    State of the interface (UP, DOWN, etc.).
    tags List<Property Map>
    List of tags applied to the interface. Each tag contains:
    displayName String
    externalId String

    Supporting Types

    GetPolicyBaremetalServerInterfaceTag

    Scope string
    Tag scope.
    Tag string
    Tag value.
    Scope string
    Tag scope.
    Tag string
    Tag value.
    scope string
    Tag scope.
    tag string
    Tag value.
    scope String
    Tag scope.
    tag String
    Tag value.
    scope string
    Tag scope.
    tag string
    Tag value.
    scope str
    Tag scope.
    tag str
    Tag value.
    scope String
    Tag scope.
    tag String
    Tag value.

    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.1
    published on Friday, Sep 11, 2026 by vmware

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial