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 policy groups for which the given bare metal server is a member. This is useful for discovering group membership and understanding firewall rule scope.
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 belongs to
const bm1Groups = nsxt.getPolicyBaremetalServerGroupAssociations({
externalId: "71be0142-2ed1-1d53-9c60-5564cf4b7e2e",
});
// Define required services
const http = new nsxt.PolicyService("http", {
displayName: "HTTP-Service",
l4PortSetEntries: [{
protocol: "TCP",
destinationPorts: ["80"],
}],
});
const https = new nsxt.PolicyService("https", {
displayName: "HTTPS-Service",
l4PortSetEntries: [{
protocol: "TCP",
destinationPorts: ["443"],
}],
});
// Define the web-servers group referenced in the security policy
const web_servers = new nsxt.PolicyGroup("web-servers", {
displayName: "Web-Servers-Group",
description: "Group containing web server bare metal resources",
criterias: [{
conditions: [{
key: "Tag",
memberType: "BareMetalServer",
operator: "EQUALS",
value: "application_tier|web",
}],
}],
});
// Use the groups in firewall policies
const bmsPolicy = new nsxt.PolicySecurityPolicy("bms_policy", {
displayName: "BMS Security Policy",
category: "Application",
rules: [{
displayName: "Allow BMS Communication",
sourceGroups: bm1Groups.then(bm1Groups => bm1Groups.groups.map(__item => __item.path)),
destinationGroups: [web_servers.path],
action: "ALLOW",
services: [
http.path,
https.path,
],
}],
});
export const serverGroups = bm1Groups.then(bm1Groups => .reduce((__obj, group) => ({ ...__obj, [group.displayName]: group.path })));
import pulumi
import pulumi_nsxt as nsxt
# Get groups that a specific bare metal server belongs to
bm1_groups = nsxt.get_policy_baremetal_server_group_associations(external_id="71be0142-2ed1-1d53-9c60-5564cf4b7e2e")
# Define required services
http = nsxt.PolicyService("http",
display_name="HTTP-Service",
l4_port_set_entries=[{
"protocol": "TCP",
"destination_ports": ["80"],
}])
https = nsxt.PolicyService("https",
display_name="HTTPS-Service",
l4_port_set_entries=[{
"protocol": "TCP",
"destination_ports": ["443"],
}])
# Define the web-servers group referenced in the security policy
web_servers = nsxt.PolicyGroup("web-servers",
display_name="Web-Servers-Group",
description="Group containing web server bare metal resources",
criterias=[{
"conditions": [{
"key": "Tag",
"member_type": "BareMetalServer",
"operator": "EQUALS",
"value": "application_tier|web",
}],
}])
# Use the groups in firewall policies
bms_policy = nsxt.PolicySecurityPolicy("bms_policy",
display_name="BMS Security Policy",
category="Application",
rules=[{
"display_name": "Allow BMS Communication",
"source_groups": [__item.path for __item in bm1_groups.groups],
"destination_groups": [web_servers.path],
"action": "ALLOW",
"services": [
http.path,
https.path,
],
}])
pulumi.export("serverGroups", {group.display_name: group.path for group in bm1_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 belongs to
var bm1Groups = Nsxt.GetPolicyBaremetalServerGroupAssociations.Invoke(new()
{
ExternalId = "71be0142-2ed1-1d53-9c60-5564cf4b7e2e",
});
// Define required services
var http = new Nsxt.PolicyService("http", new()
{
DisplayName = "HTTP-Service",
L4PortSetEntries = new[]
{
new Nsxt.Inputs.PolicyServiceL4PortSetEntryArgs
{
Protocol = "TCP",
DestinationPorts = new[]
{
"80",
},
},
},
});
var https = new Nsxt.PolicyService("https", new()
{
DisplayName = "HTTPS-Service",
L4PortSetEntries = new[]
{
new Nsxt.Inputs.PolicyServiceL4PortSetEntryArgs
{
Protocol = "TCP",
DestinationPorts = new[]
{
"443",
},
},
},
});
// Define the web-servers group referenced in the security policy
var web_servers = new Nsxt.PolicyGroup("web-servers", new()
{
DisplayName = "Web-Servers-Group",
Description = "Group containing web server bare metal resources",
Criterias = new[]
{
new Nsxt.Inputs.PolicyGroupCriteriaArgs
{
Conditions = new[]
{
new Nsxt.Inputs.PolicyGroupCriteriaConditionArgs
{
Key = "Tag",
MemberType = "BareMetalServer",
Operator = "EQUALS",
Value = "application_tier|web",
},
},
},
},
});
// Use the groups in firewall policies
var bmsPolicy = new Nsxt.PolicySecurityPolicy("bms_policy", new()
{
DisplayName = "BMS Security Policy",
Category = "Application",
Rules = new[]
{
new Nsxt.Inputs.PolicySecurityPolicyRuleArgs
{
DisplayName = "Allow BMS Communication",
SourceGroups = bm1Groups.Apply(getPolicyBaremetalServerGroupAssociationsResult => getPolicyBaremetalServerGroupAssociationsResult.Groups).Select(__item => __item.Path).ToList(),
DestinationGroups = new[]
{
web_servers.Path,
},
Action = "ALLOW",
Services = new[]
{
http.Path,
https.Path,
},
},
},
});
return new Dictionary<string, object?>
{
["serverGroups"] = .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 getPolicyBaremetalServerGroupAssociations
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 getPolicyBaremetalServerGroupAssociations(args: GetPolicyBaremetalServerGroupAssociationsArgs, opts?: InvokeOptions): Promise<GetPolicyBaremetalServerGroupAssociationsResult>
function getPolicyBaremetalServerGroupAssociationsOutput(args: GetPolicyBaremetalServerGroupAssociationsOutputArgs, opts?: InvokeOutputOptions): Output<GetPolicyBaremetalServerGroupAssociationsResult>def get_policy_baremetal_server_group_associations(enforcement_point_path: Optional[str] = None,
external_id: Optional[str] = None,
id: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetPolicyBaremetalServerGroupAssociationsResult
def get_policy_baremetal_server_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[GetPolicyBaremetalServerGroupAssociationsResult]func GetPolicyBaremetalServerGroupAssociations(ctx *Context, args *GetPolicyBaremetalServerGroupAssociationsArgs, opts ...InvokeOption) (*GetPolicyBaremetalServerGroupAssociationsResult, error)
func GetPolicyBaremetalServerGroupAssociationsOutput(ctx *Context, args *GetPolicyBaremetalServerGroupAssociationsOutputArgs, opts ...InvokeOption) GetPolicyBaremetalServerGroupAssociationsResultOutput> Note: This function is named GetPolicyBaremetalServerGroupAssociations in the Go SDK.
public static class GetPolicyBaremetalServerGroupAssociations
{
public static Task<GetPolicyBaremetalServerGroupAssociationsResult> InvokeAsync(GetPolicyBaremetalServerGroupAssociationsArgs args, InvokeOptions? opts = null)
public static Output<GetPolicyBaremetalServerGroupAssociationsResult> Invoke(GetPolicyBaremetalServerGroupAssociationsInvokeArgs args, InvokeOptions? opts = null)
public static Output<GetPolicyBaremetalServerGroupAssociationsResult> Invoke(GetPolicyBaremetalServerGroupAssociationsInvokeArgs args, InvokeOutputOptions opts)
}public static CompletableFuture<GetPolicyBaremetalServerGroupAssociationsResult> getPolicyBaremetalServerGroupAssociations(GetPolicyBaremetalServerGroupAssociationsArgs args, InvokeOptions options)
public static Output<GetPolicyBaremetalServerGroupAssociationsResult> getPolicyBaremetalServerGroupAssociations(GetPolicyBaremetalServerGroupAssociationsArgs args, InvokeOptions options)
public static Output<GetPolicyBaremetalServerGroupAssociationsResult> getPolicyBaremetalServerGroupAssociations(GetPolicyBaremetalServerGroupAssociationsArgs args, InvokeOutputOptions options)
fn::invoke:
function: nsxt:index/getPolicyBaremetalServerGroupAssociations:getPolicyBaremetalServerGroupAssociations
arguments:
# arguments dictionarydata "nsxt_get_policy_baremetal_server_group_associations" "name" {
# arguments
}The following arguments are supported:
- External
Id string - External ID of the bare metal server.
- Enforcement
Point stringPath - Path of the enforcement point.
- Id string
- ID of the data source.
- External
Id string - External ID of the bare metal server.
- Enforcement
Point stringPath - Path of the enforcement point.
- Id string
- ID of the data source.
- external_
id string - External ID of the bare metal server.
- enforcement_
point_ stringpath - Path of the enforcement point.
- id string
- ID of the data source.
- external
Id String - External ID of the bare metal server.
- enforcement
Point StringPath - Path of the enforcement point.
- id String
- ID of the data source.
- external
Id string - External ID of the bare metal server.
- enforcement
Point stringPath - Path of the enforcement point.
- id string
- ID of the data source.
- external_
id str - External ID of the bare metal server.
- enforcement_
point_ strpath - Path of the enforcement point.
- id str
- ID of the data source.
- external
Id String - External ID of the bare metal server.
- enforcement
Point StringPath - Path of the enforcement point.
- id String
- ID of the data source.
getPolicyBaremetalServerGroupAssociations Result
The following output properties are available:
- External
Id string - Groups
List<Get
Policy Baremetal Server Group Associations Group> - List of groups this bare metal server is a member of. Each group contains:
- Id string
- ID of the data source.
- Enforcement
Point stringPath
- External
Id string - Groups
[]Get
Policy Baremetal Server Group Associations Group - List of groups this bare metal server is a member of. Each group contains:
- Id string
- ID of the data source.
- Enforcement
Point stringPath
- external_
id string - groups list(object)
- List of groups this bare metal server is a member of. Each group contains:
- id string
- ID of the data source.
- enforcement_
point_ stringpath
- external
Id String - groups
List<Get
Policy Baremetal Server Group Associations Group> - List of groups this bare metal server is a member of. Each group contains:
- id String
- ID of the data source.
- enforcement
Point StringPath
- external
Id string - groups
Get
Policy Baremetal Server Group Associations Group[] - List of groups this bare metal server is a member of. Each group contains:
- id string
- ID of the data source.
- enforcement
Point stringPath
- external_
id str - groups
Sequence[Get
Policy Baremetal Server Group Associations Group] - List of groups this bare metal server is a member of. Each group contains:
- id str
- ID of the data source.
- enforcement_
point_ strpath
- external
Id String - groups List<Property Map>
- List of groups this bare metal server is a member of. Each group contains:
- id String
- ID of the data source.
- enforcement
Point StringPath
Supporting Types
GetPolicyBaremetalServerGroupAssociationsGroup
- 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.
- 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.
- 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.
- display
Name String - Display name of the group.
- is
Valid Boolean - Indicates if the referenced NSX resource is valid.
- path String
- Policy path of the group.
- target
Type String - Type of the target resource.
- display
Name string - Display name of the group.
- is
Valid boolean - Indicates if the referenced NSX resource is valid.
- path string
- Policy path of the group.
- target
Type 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.
- display
Name String - Display name of the group.
- is
Valid Boolean - Indicates if the referenced NSX resource is valid.
- path String
- Policy path of the group.
- target
Type String - Type of the target resource.
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