1. Registry
  2. Packages
  3. Nsxt Provider
  4. API Docs
  5. getPolicyBaremetalServerInterfaceGroupAssociations
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 policy groups for which the given bare metal server interface is a member. This is useful for discovering group membership and understanding network segmentation.

    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";
    
    // Get groups that a specific bare metal server interface belongs to
    const if1Groups = nsxt.getPolicyBaremetalServerInterfaceGroupAssociations({
        externalId: "71be0142-2ed1-1d53-9c60-02005b4b7246",
    });
    // Define the data-network group referenced in the security policy
    const data_network = new nsxt.PolicyGroup("data-network", {
        displayName: "Data-Network-Group",
        description: "Group containing data network interfaces",
        criterias: [{
            conditions: [{
                key: "Tag",
                memberType: "BareMetalServerInterface",
                operator: "EQUALS",
                value: "network_zone|data",
            }],
        }],
    });
    // Use the groups in security policies
    const interfacePolicy = new nsxt.PolicySecurityPolicy("interface_policy", {
        displayName: "BMS Interface Security Policy",
        category: "Infrastructure",
        rules: [{
            displayName: "Allow Interface Traffic",
            sourceGroups: if1Groups.then(if1Groups => if1Groups.groups.map(__item => __item.path)),
            destinationGroups: [data_network.path],
            action: "ALLOW",
            services: [],
        }],
    });
    export const interfaceGroups = if1Groups.then(if1Groups => .reduce((__obj, group) => ({ ...__obj, [group.displayName]: group.path })));
    
    import pulumi
    import pulumi_nsxt as nsxt
    
    # Get groups that a specific bare metal server interface belongs to
    if1_groups = nsxt.get_policy_baremetal_server_interface_group_associations(external_id="71be0142-2ed1-1d53-9c60-02005b4b7246")
    # Define the data-network group referenced in the security policy
    data_network = nsxt.PolicyGroup("data-network",
        display_name="Data-Network-Group",
        description="Group containing data network interfaces",
        criterias=[{
            "conditions": [{
                "key": "Tag",
                "member_type": "BareMetalServerInterface",
                "operator": "EQUALS",
                "value": "network_zone|data",
            }],
        }])
    # Use the groups in security policies
    interface_policy = nsxt.PolicySecurityPolicy("interface_policy",
        display_name="BMS Interface Security Policy",
        category="Infrastructure",
        rules=[{
            "display_name": "Allow Interface Traffic",
            "source_groups": [__item.path for __item in if1_groups.groups],
            "destination_groups": [data_network.path],
            "action": "ALLOW",
            "services": [],
        }])
    pulumi.export("interfaceGroups", {group.display_name: group.path for group in if1_groups.groups})
    
    Example coming soon!
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Nsxt = Pulumi.Nsxt;
    
    return await Deployment.RunAsync(() => 
    {
        // Get groups that a specific bare metal server interface belongs to
        var if1Groups = Nsxt.GetPolicyBaremetalServerInterfaceGroupAssociations.Invoke(new()
        {
            ExternalId = "71be0142-2ed1-1d53-9c60-02005b4b7246",
        });
    
        // Define the data-network group referenced in the security policy
        var data_network = new Nsxt.PolicyGroup("data-network", new()
        {
            DisplayName = "Data-Network-Group",
            Description = "Group containing data network interfaces",
            Criterias = new[]
            {
                new Nsxt.Inputs.PolicyGroupCriteriaArgs
                {
                    Conditions = new[]
                    {
                        new Nsxt.Inputs.PolicyGroupCriteriaConditionArgs
                        {
                            Key = "Tag",
                            MemberType = "BareMetalServerInterface",
                            Operator = "EQUALS",
                            Value = "network_zone|data",
                        },
                    },
                },
            },
        });
    
        // Use the groups in security policies
        var interfacePolicy = new Nsxt.PolicySecurityPolicy("interface_policy", new()
        {
            DisplayName = "BMS Interface Security Policy",
            Category = "Infrastructure",
            Rules = new[]
            {
                new Nsxt.Inputs.PolicySecurityPolicyRuleArgs
                {
                    DisplayName = "Allow Interface Traffic",
                    SourceGroups = if1Groups.Apply(getPolicyBaremetalServerInterfaceGroupAssociationsResult => getPolicyBaremetalServerInterfaceGroupAssociationsResult.Groups).Select(__item => __item.Path).ToList(),
                    DestinationGroups = new[]
                    {
                        data_network.Path,
                    },
                    Action = "ALLOW",
                    Services = new() { },
                },
            },
        });
    
        return new Dictionary<string, object?>
        {
            ["interfaceGroups"] = .ToDictionary(item => {
                var group = item.Value;
                return @group.DisplayName;
            }, item => {
                var group = item.Value;
                return @group.Path;
            }),
        };
    });
    
    Example coming soon!
    
    Example coming soon!
    
    Example coming soon!
    

    Using getPolicyBaremetalServerInterfaceGroupAssociations

    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 getPolicyBaremetalServerInterfaceGroupAssociations(args: GetPolicyBaremetalServerInterfaceGroupAssociationsArgs, opts?: InvokeOptions): Promise<GetPolicyBaremetalServerInterfaceGroupAssociationsResult>
    function getPolicyBaremetalServerInterfaceGroupAssociationsOutput(args: GetPolicyBaremetalServerInterfaceGroupAssociationsOutputArgs, opts?: InvokeOutputOptions): Output<GetPolicyBaremetalServerInterfaceGroupAssociationsResult>
    def get_policy_baremetal_server_interface_group_associations(enforcement_point_path: Optional[str] = None,
                                                                 external_id: Optional[str] = None,
                                                                 id: Optional[str] = None,
                                                                 opts: Optional[InvokeOptions] = None) -> GetPolicyBaremetalServerInterfaceGroupAssociationsResult
    def get_policy_baremetal_server_interface_group_associations_output(enforcement_point_path: pulumi.Input[Optional[str]] = None,
                                                                 external_id: pulumi.Input[Optional[str]] = None,
                                                                 id: pulumi.Input[Optional[str]] = None,
                                                                 opts: Optional[InvokeOutputOptions] = None) -> Output[GetPolicyBaremetalServerInterfaceGroupAssociationsResult]
    func GetPolicyBaremetalServerInterfaceGroupAssociations(ctx *Context, args *GetPolicyBaremetalServerInterfaceGroupAssociationsArgs, opts ...InvokeOption) (*GetPolicyBaremetalServerInterfaceGroupAssociationsResult, error)
    func GetPolicyBaremetalServerInterfaceGroupAssociationsOutput(ctx *Context, args *GetPolicyBaremetalServerInterfaceGroupAssociationsOutputArgs, opts ...InvokeOption) GetPolicyBaremetalServerInterfaceGroupAssociationsResultOutput

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

    public static class GetPolicyBaremetalServerInterfaceGroupAssociations 
    {
        public static Task<GetPolicyBaremetalServerInterfaceGroupAssociationsResult> InvokeAsync(GetPolicyBaremetalServerInterfaceGroupAssociationsArgs args, InvokeOptions? opts = null)
        public static Output<GetPolicyBaremetalServerInterfaceGroupAssociationsResult> Invoke(GetPolicyBaremetalServerInterfaceGroupAssociationsInvokeArgs args, InvokeOptions? opts = null)
        public static Output<GetPolicyBaremetalServerInterfaceGroupAssociationsResult> Invoke(GetPolicyBaremetalServerInterfaceGroupAssociationsInvokeArgs args, InvokeOutputOptions opts)
    }
    public static CompletableFuture<GetPolicyBaremetalServerInterfaceGroupAssociationsResult> getPolicyBaremetalServerInterfaceGroupAssociations(GetPolicyBaremetalServerInterfaceGroupAssociationsArgs args, InvokeOptions options)
    public static Output<GetPolicyBaremetalServerInterfaceGroupAssociationsResult> getPolicyBaremetalServerInterfaceGroupAssociations(GetPolicyBaremetalServerInterfaceGroupAssociationsArgs args, InvokeOptions options)
    public static Output<GetPolicyBaremetalServerInterfaceGroupAssociationsResult> getPolicyBaremetalServerInterfaceGroupAssociations(GetPolicyBaremetalServerInterfaceGroupAssociationsArgs args, InvokeOutputOptions options)
    
    fn::invoke:
      function: nsxt:index/getPolicyBaremetalServerInterfaceGroupAssociations:getPolicyBaremetalServerInterfaceGroupAssociations
      arguments:
        # arguments dictionary
    data "nsxt_get_policy_baremetal_server_interface_group_associations" "name" {
        # arguments
    }

    The following arguments are supported:

    ExternalId string
    External ID of the bare metal server interface.
    EnforcementPointPath string
    Path of the enforcement point.
    Id string
    ID of the data source.
    ExternalId string
    External ID of the bare metal server interface.
    EnforcementPointPath string
    Path of the enforcement point.
    Id string
    ID of the data source.
    external_id string
    External ID of the bare metal server interface.
    enforcement_point_path string
    Path of the enforcement point.
    id string
    ID of the data source.
    externalId String
    External ID of the bare metal server interface.
    enforcementPointPath String
    Path of the enforcement point.
    id String
    ID of the data source.
    externalId string
    External ID of the bare metal server interface.
    enforcementPointPath string
    Path of the enforcement point.
    id string
    ID of the data source.
    external_id str
    External ID of the bare metal server interface.
    enforcement_point_path str
    Path of the enforcement point.
    id str
    ID of the data source.
    externalId String
    External ID of the bare metal server interface.
    enforcementPointPath String
    Path of the enforcement point.
    id String
    ID of the data source.

    getPolicyBaremetalServerInterfaceGroupAssociations Result

    The following output properties are available:

    ExternalId string
    Groups List<GetPolicyBaremetalServerInterfaceGroupAssociationsGroup>
    List of groups this bare metal server interface is a member of. Each group contains:
    Id string
    ID of the data source.
    EnforcementPointPath string
    ExternalId string
    Groups []GetPolicyBaremetalServerInterfaceGroupAssociationsGroup
    List of groups this bare metal server interface is a member of. Each group contains:
    Id string
    ID of the data source.
    EnforcementPointPath string
    external_id string
    groups list(object)
    List of groups this bare metal server interface is a member of. Each group contains:
    id string
    ID of the data source.
    enforcement_point_path string
    externalId String
    groups List<GetPolicyBaremetalServerInterfaceGroupAssociationsGroup>
    List of groups this bare metal server interface is a member of. Each group contains:
    id String
    ID of the data source.
    enforcementPointPath String
    externalId string
    groups GetPolicyBaremetalServerInterfaceGroupAssociationsGroup[]
    List of groups this bare metal server interface is a member of. Each group contains:
    id string
    ID of the data source.
    enforcementPointPath string
    external_id str
    groups Sequence[GetPolicyBaremetalServerInterfaceGroupAssociationsGroup]
    List of groups this bare metal server interface is a member of. Each group contains:
    id str
    ID of the data source.
    enforcement_point_path str
    externalId String
    groups List<Property Map>
    List of groups this bare metal server interface is a member of. Each group contains:
    id String
    ID of the data source.
    enforcementPointPath String

    Supporting Types

    GetPolicyBaremetalServerInterfaceGroupAssociationsGroup

    DisplayName string
    Display name of the group.
    IsValid bool
    Indicates if the referenced NSX resource is valid.
    Path string
    Policy path of the group.
    TargetType string
    Type of the target resource.
    DisplayName string
    Display name of the group.
    IsValid bool
    Indicates if the referenced NSX resource is valid.
    Path string
    Policy path of the group.
    TargetType string
    Type of the target resource.
    display_name string
    Display name of the group.
    is_valid bool
    Indicates if the referenced NSX resource is valid.
    path string
    Policy path of the group.
    target_type string
    Type of the target resource.
    displayName String
    Display name of the group.
    isValid Boolean
    Indicates if the referenced NSX resource is valid.
    path String
    Policy path of the group.
    targetType String
    Type of the target resource.
    displayName string
    Display name of the group.
    isValid boolean
    Indicates if the referenced NSX resource is valid.
    path string
    Policy path of the group.
    targetType string
    Type of the target resource.
    display_name str
    Display name of the group.
    is_valid bool
    Indicates if the referenced NSX resource is valid.
    path str
    Policy path of the group.
    target_type str
    Type of the target resource.
    displayName String
    Display name of the group.
    isValid Boolean
    Indicates if the referenced NSX resource is valid.
    path String
    Policy path of the group.
    targetType String
    Type of the target resource.

    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