published on Friday, Sep 11, 2026 by vmware
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 dictionarydata "nsxt_get_policy_baremetal_server_interface" "name" {
# arguments
}The following arguments are supported:
- 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_idordisplay_namemust be specified. If usingdisplay_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.
- 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_idordisplay_namemust be specified. If usingdisplay_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.
- 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_idordisplay_namemust be specified. If usingdisplay_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.
- 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_idordisplay_namemust be specified. If usingdisplay_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.
- 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_idordisplay_namemust be specified. If usingdisplay_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.
- 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_idordisplay_namemust be specified. If usingdisplay_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.
- 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_idordisplay_namemust be specified. If usingdisplay_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.
getPolicyBaremetalServerInterface Result
The following output properties are available:
- Bms
External stringId - 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 boolInterface - Whether this is a management interface.
- Last
Sync doubleTime - 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.).
-
List<Get
Policy Baremetal Server Interface Tag> - List of tags applied to the interface. Each tag contains:
- Display
Name string - External
Id string
- Bms
External stringId - External ID of the parent bare metal server.
- Id string
- ID of the data source.
- Ip
Addresses []string - List of IP addresses assigned to the interface.
- Is
Mgmt boolInterface - Whether this is a management interface.
- Last
Sync float64Time - 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.).
-
[]Get
Policy Baremetal Server Interface Tag - List of tags applied to the interface. Each tag contains:
- Display
Name string - External
Id string
- bms_
external_ stringid - 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_ boolinterface - Whether this is a management interface.
- last_
sync_ numbertime - 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.).
- list(object)
- List of tags applied to the interface. Each tag contains:
- display_
name string - external_
id string
- bms
External StringId - 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 BooleanInterface - Whether this is a management interface.
- last
Sync DoubleTime - 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.).
-
List<Get
Policy Baremetal Server Interface Tag> - List of tags applied to the interface. Each tag contains:
- display
Name String - external
Id String
- bms
External stringId - External ID of the parent bare metal server.
- id string
- ID of the data source.
- ip
Addresses string[] - List of IP addresses assigned to the interface.
- is
Mgmt booleanInterface - Whether this is a management interface.
- last
Sync numberTime - 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.).
-
Get
Policy Baremetal Server Interface Tag[] - List of tags applied to the interface. Each tag contains:
- display
Name string - external
Id string
- bms_
external_ strid - 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_ boolinterface - Whether this is a management interface.
- last_
sync_ floattime - 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.).
-
Sequence[Get
Policy Baremetal Server Interface Tag] - List of tags applied to the interface. Each tag contains:
- display_
name str - external_
id str
- bms
External StringId - 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 BooleanInterface - Whether this is a management interface.
- last
Sync NumberTime - 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.).
- List<Property Map>
- List of tags applied to the interface. Each tag contains:
- display
Name String - external
Id String
Supporting Types
GetPolicyBaremetalServerInterfaceTag
Package Details
- Repository
- nsxt vmware/terraform-provider-nsxt
- License
- Notes
- This Pulumi package is based on the
nsxtTerraform Provider.
published on Friday, Sep 11, 2026 by vmware