Viewing docs for nsxt 3.12.1
published on Friday, Sep 11, 2026 by vmware
published on Friday, Sep 11, 2026 by vmware
Viewing docs for nsxt 3.12.1
published on Friday, Sep 11, 2026 by vmware
published on Friday, Sep 11, 2026 by vmware
This data source provides information about tags applied to a Bare Metal Server Interface in NSX-T Policy.
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";
const test = nsxt.getPolicyBaremetalServerInterfaceTags({
externalId: "71be0142-2ed1-1d53-9c60-02005b4b7246",
});
import pulumi
import pulumi_nsxt as nsxt
test = nsxt.get_policy_baremetal_server_interface_tags(external_id="71be0142-2ed1-1d53-9c60-02005b4b7246")
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.LookupPolicyBaremetalServerInterfaceTags(ctx, &nsxt.LookupPolicyBaremetalServerInterfaceTagsArgs{
ExternalId: "71be0142-2ed1-1d53-9c60-02005b4b7246",
}, 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 test = Nsxt.GetPolicyBaremetalServerInterfaceTags.Invoke(new()
{
ExternalId = "71be0142-2ed1-1d53-9c60-02005b4b7246",
});
});
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.GetPolicyBaremetalServerInterfaceTagsArgs;
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.getPolicyBaremetalServerInterfaceTags(GetPolicyBaremetalServerInterfaceTagsArgs.builder()
.externalId("71be0142-2ed1-1d53-9c60-02005b4b7246")
.build());
}
}
variables:
test:
fn::invoke:
function: nsxt:getPolicyBaremetalServerInterfaceTags
arguments:
externalId: 71be0142-2ed1-1d53-9c60-02005b4b7246
Example coming soon!
Using With BMS Interface Discovery
import * as pulumi from "@pulumi/pulumi";
import * as nsxt from "@pulumi/nsxt";
export = async () => {
// First discover BMS interfaces
const dataInterfaces = await nsxt.getPolicyBaremetalServerInterfaces({
bmsExternalId: "71be0142-2ed1-1d53-9c60-5564cf4b7e2e",
});
// Then get tags for a specific interface
const interfaceTags = await nsxt.getPolicyBaremetalServerInterfaceTags({
externalId: dataInterfaces.results?.[0]?.externalId,
});
const networkType = .filter(tag => tag.scope == "network-type").map(tag => (tag.tag))[0];
// Conditional resource creation based on network type
const dataPlaneInterfaces: nsxt.PolicyGroup[] = [];
for (const range = {value: 0}; range.value < (networkType == "data-plane" ? 1 : 0); range.value++) {
dataPlaneInterfaces.push(new nsxt.PolicyGroup(`data_plane_interfaces-${range.value}`, {
displayName: "Data-Plane-Interfaces",
criterias: [{
conditions: [{
key: "Tag",
memberType: "BareMetalServerInterface",
operator: "EQUALS",
value: "network-type|data-plane",
}],
}],
}));
}
}
import pulumi
import pulumi_nsxt as nsxt
# First discover BMS interfaces
data_interfaces = nsxt.get_policy_baremetal_server_interfaces(bms_external_id="71be0142-2ed1-1d53-9c60-5564cf4b7e2e")
# Then get tags for a specific interface
interface_tags = nsxt.get_policy_baremetal_server_interface_tags(external_id=data_interfaces.results[0].external_id)
network_type = [tag.tag for tag in interface_tags.tags if tag.scope == "network-type"][0]
# Conditional resource creation based on network type
data_plane_interfaces = []
for range in [{"value": i} for i in range(0, 1 if network_type == data-plane else 0)]:
data_plane_interfaces.append(nsxt.PolicyGroup(f"data_plane_interfaces-{range['value']}",
display_name="Data-Plane-Interfaces",
criterias=[{
"conditions": [{
"key": "Tag",
"member_type": "BareMetalServerInterface",
"operator": "EQUALS",
"value": "network-type|data-plane",
}],
}]))
Example coming soon!
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Pulumi;
using Nsxt = Pulumi.Nsxt;
return await Deployment.RunAsync(async() =>
{
// First discover BMS interfaces
var dataInterfaces = await Nsxt.GetPolicyBaremetalServerInterfaces.InvokeAsync(new()
{
BmsExternalId = "71be0142-2ed1-1d53-9c60-5564cf4b7e2e",
});
// Then get tags for a specific interface
var interfaceTags = await Nsxt.GetPolicyBaremetalServerInterfaceTags.InvokeAsync(new()
{
ExternalId = dataInterfaces.Results[0]?.ExternalId,
});
var networkType = [0];
// Conditional resource creation based on network type
var dataPlaneInterfaces = new List<Nsxt.PolicyGroup>();
for (var rangeIndex = 0; rangeIndex < networkType == "data-plane" ? 1 : 0; rangeIndex++)
{
var range = new { Value = rangeIndex };
dataPlaneInterfaces.Add(new Nsxt.PolicyGroup($"data_plane_interfaces-{range.Value}", new()
{
DisplayName = "Data-Plane-Interfaces",
Criterias = new[]
{
new Nsxt.Inputs.PolicyGroupCriteriaArgs
{
Conditions = new[]
{
new Nsxt.Inputs.PolicyGroupCriteriaConditionArgs
{
Key = "Tag",
MemberType = "BareMetalServerInterface",
Operator = "EQUALS",
Value = "network-type|data-plane",
},
},
},
},
}));
}
});
Example coming soon!
Example coming soon!
Example coming soon!
Common Tag Scopes
Common tag scopes used for BMS interfaces include:
network-type- Values likedata-plane,management,storagevlan- VLAN ID for the interfacenetwork-zone- Network zone designation (e.g.,dmz,internal)environment- Environment designation (e.g.,production,staging)
Notes
- This data source retrieves tags that have been applied to BMS interfaces using the
nsxt.PolicyBaremetalServerInterfaceTagsresource or other NSX-T mechanisms. - Interface tags are commonly used for network segmentation and policy application.
- The
external_idmust be the external ID of a Bare Metal Server Interface that exists in NSX-T inventory.
Using getPolicyBaremetalServerInterfaceTags
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 getPolicyBaremetalServerInterfaceTags(args: GetPolicyBaremetalServerInterfaceTagsArgs, opts?: InvokeOptions): Promise<GetPolicyBaremetalServerInterfaceTagsResult>
function getPolicyBaremetalServerInterfaceTagsOutput(args: GetPolicyBaremetalServerInterfaceTagsOutputArgs, opts?: InvokeOutputOptions): Output<GetPolicyBaremetalServerInterfaceTagsResult>def get_policy_baremetal_server_interface_tags(external_id: Optional[str] = None,
id: Optional[str] = None,
tags: Optional[Sequence[GetPolicyBaremetalServerInterfaceTagsTag]] = None,
opts: Optional[InvokeOptions] = None) -> GetPolicyBaremetalServerInterfaceTagsResult
def get_policy_baremetal_server_interface_tags_output(external_id: pulumi.Input[Optional[str]] = None,
id: pulumi.Input[Optional[str]] = None,
tags: pulumi.Input[Optional[Sequence[pulumi.Input[GetPolicyBaremetalServerInterfaceTagsTagArgs]]]] = None,
opts: Optional[InvokeOutputOptions] = None) -> Output[GetPolicyBaremetalServerInterfaceTagsResult]func LookupPolicyBaremetalServerInterfaceTags(ctx *Context, args *LookupPolicyBaremetalServerInterfaceTagsArgs, opts ...InvokeOption) (*LookupPolicyBaremetalServerInterfaceTagsResult, error)
func LookupPolicyBaremetalServerInterfaceTagsOutput(ctx *Context, args *LookupPolicyBaremetalServerInterfaceTagsOutputArgs, opts ...InvokeOption) LookupPolicyBaremetalServerInterfaceTagsResultOutput> Note: This function is named LookupPolicyBaremetalServerInterfaceTags in the Go SDK.
public static class GetPolicyBaremetalServerInterfaceTags
{
public static Task<GetPolicyBaremetalServerInterfaceTagsResult> InvokeAsync(GetPolicyBaremetalServerInterfaceTagsArgs args, InvokeOptions? opts = null)
public static Output<GetPolicyBaremetalServerInterfaceTagsResult> Invoke(GetPolicyBaremetalServerInterfaceTagsInvokeArgs args, InvokeOptions? opts = null)
public static Output<GetPolicyBaremetalServerInterfaceTagsResult> Invoke(GetPolicyBaremetalServerInterfaceTagsInvokeArgs args, InvokeOutputOptions opts)
}public static CompletableFuture<GetPolicyBaremetalServerInterfaceTagsResult> getPolicyBaremetalServerInterfaceTags(GetPolicyBaremetalServerInterfaceTagsArgs args, InvokeOptions options)
public static Output<GetPolicyBaremetalServerInterfaceTagsResult> getPolicyBaremetalServerInterfaceTags(GetPolicyBaremetalServerInterfaceTagsArgs args, InvokeOptions options)
public static Output<GetPolicyBaremetalServerInterfaceTagsResult> getPolicyBaremetalServerInterfaceTags(GetPolicyBaremetalServerInterfaceTagsArgs args, InvokeOutputOptions options)
fn::invoke:
function: nsxt:index/getPolicyBaremetalServerInterfaceTags:getPolicyBaremetalServerInterfaceTags
arguments:
# arguments dictionarydata "nsxt_get_policy_baremetal_server_interface_tags" "name" {
# arguments
}The following arguments are supported:
- External
Id string - External ID of the Bare Metal Server Interface to retrieve tags for.
- Id string
- ID of the data source (same as
external_id). -
List<Get
Policy Baremetal Server Interface Tags Tag> - Tag value.
- External
Id string - External ID of the Bare Metal Server Interface to retrieve tags for.
- Id string
- ID of the data source (same as
external_id). -
[]Get
Policy Baremetal Server Interface Tags Tag - Tag value.
- external_
id string - External ID of the Bare Metal Server Interface to retrieve tags for.
- id string
- ID of the data source (same as
external_id). - list(object)
- Tag value.
- external
Id String - External ID of the Bare Metal Server Interface to retrieve tags for.
- id String
- ID of the data source (same as
external_id). -
List<Get
Policy Baremetal Server Interface Tags Tag> - Tag value.
- external
Id string - External ID of the Bare Metal Server Interface to retrieve tags for.
- id string
- ID of the data source (same as
external_id). -
Get
Policy Baremetal Server Interface Tags Tag[] - Tag value.
- external_
id str - External ID of the Bare Metal Server Interface to retrieve tags for.
- id str
- ID of the data source (same as
external_id). -
Sequence[Get
Policy Baremetal Server Interface Tags Tag] - Tag value.
- external
Id String - External ID of the Bare Metal Server Interface to retrieve tags for.
- id String
- ID of the data source (same as
external_id). - List<Property Map>
- Tag value.
getPolicyBaremetalServerInterfaceTags Result
The following output properties are available:
- External
Id string - Id string
- ID of the data source (same as
external_id). -
List<Get
Policy Baremetal Server Interface Tags Tag> - Tag value.
- External
Id string - Id string
- ID of the data source (same as
external_id). -
[]Get
Policy Baremetal Server Interface Tags Tag - Tag value.
- external_
id string - id string
- ID of the data source (same as
external_id). - list(object)
- Tag value.
- external
Id String - id String
- ID of the data source (same as
external_id). -
List<Get
Policy Baremetal Server Interface Tags Tag> - Tag value.
- external
Id string - id string
- ID of the data source (same as
external_id). -
Get
Policy Baremetal Server Interface Tags Tag[] - Tag value.
- external_
id str - id str
- ID of the data source (same as
external_id). -
Sequence[Get
Policy Baremetal Server Interface Tags Tag] - Tag value.
- external
Id String - id String
- ID of the data source (same as
external_id). - List<Property Map>
- Tag value.
Supporting Types
GetPolicyBaremetalServerInterfaceTagsTag
Package Details
- Repository
- nsxt vmware/terraform-provider-nsxt
- License
- Notes
- This Pulumi package is based on the
nsxtTerraform Provider.
Viewing docs for nsxt 3.12.1
published on Friday, Sep 11, 2026 by vmware
published on Friday, Sep 11, 2026 by vmware