Viewing docs for nsxt 3.11.0
published on Monday, Dec 15, 2025 by vmware
published on Monday, Dec 15, 2025 by vmware
Viewing docs for nsxt 3.11.0
published on Monday, Dec 15, 2025 by vmware
published on Monday, Dec 15, 2025 by vmware
This data source builds a “name to uuid” map of the whole NS Group table. Such map can be referenced in configuration to obtain object uuids by display name at a cost of single roundtrip to NSX, which improves apply and refresh
time at scale, compared to multiple instances of nsxt.NsGroup data source.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as nsxt from "@pulumi/nsxt";
const map = nsxt.getNsGroups({});
const s1 = new nsxt.FirewallSection("s1", {
displayName: "section1",
appliedTos: [{
targetType: "NSGroup",
targetId: map.then(map => map.items?.group1),
}],
sectionType: "LAYER3",
});
import pulumi
import pulumi_nsxt as nsxt
map = nsxt.get_ns_groups()
s1 = nsxt.FirewallSection("s1",
display_name="section1",
applied_tos=[{
"target_type": "NSGroup",
"target_id": map.items["group1"],
}],
section_type="LAYER3")
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 {
_map, err := nsxt.GetNsGroups(ctx, &nsxt.GetNsGroupsArgs{}, nil)
if err != nil {
return err
}
_, err = nsxt.NewFirewallSection(ctx, "s1", &nsxt.FirewallSectionArgs{
DisplayName: pulumi.String("section1"),
AppliedTos: nsxt.FirewallSectionAppliedToArray{
&nsxt.FirewallSectionAppliedToArgs{
TargetType: pulumi.String("NSGroup"),
TargetId: pulumi.String(_map.Items.Group1),
},
},
SectionType: pulumi.String("LAYER3"),
})
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 map = Nsxt.GetNsGroups.Invoke();
var s1 = new Nsxt.FirewallSection("s1", new()
{
DisplayName = "section1",
AppliedTos = new[]
{
new Nsxt.Inputs.FirewallSectionAppliedToArgs
{
TargetType = "NSGroup",
TargetId = map.Apply(getNsGroupsResult => getNsGroupsResult.Items?.Group1),
},
},
SectionType = "LAYER3",
});
});
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.GetNsGroupsArgs;
import com.pulumi.nsxt.FirewallSection;
import com.pulumi.nsxt.FirewallSectionArgs;
import com.pulumi.nsxt.inputs.FirewallSectionAppliedToArgs;
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 map = NsxtFunctions.getNsGroups(GetNsGroupsArgs.builder()
.build());
var s1 = new FirewallSection("s1", FirewallSectionArgs.builder()
.displayName("section1")
.appliedTos(FirewallSectionAppliedToArgs.builder()
.targetType("NSGroup")
.targetId(map.items().group1())
.build())
.sectionType("LAYER3")
.build());
}
}
resources:
s1:
type: nsxt:FirewallSection
properties:
displayName: section1
appliedTos:
- targetType: NSGroup
targetId: ${map.items.group1}
sectionType: LAYER3
variables:
map:
fn::invoke:
function: nsxt:getNsGroups
arguments: {}
Using getNsGroups
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 getNsGroups(args: GetNsGroupsArgs, opts?: InvokeOptions): Promise<GetNsGroupsResult>
function getNsGroupsOutput(args: GetNsGroupsOutputArgs, opts?: InvokeOptions): Output<GetNsGroupsResult>def get_ns_groups(id: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetNsGroupsResult
def get_ns_groups_output(id: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetNsGroupsResult]func GetNsGroups(ctx *Context, args *GetNsGroupsArgs, opts ...InvokeOption) (*GetNsGroupsResult, error)
func GetNsGroupsOutput(ctx *Context, args *GetNsGroupsOutputArgs, opts ...InvokeOption) GetNsGroupsResultOutput> Note: This function is named GetNsGroups in the Go SDK.
public static class GetNsGroups
{
public static Task<GetNsGroupsResult> InvokeAsync(GetNsGroupsArgs args, InvokeOptions? opts = null)
public static Output<GetNsGroupsResult> Invoke(GetNsGroupsInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetNsGroupsResult> getNsGroups(GetNsGroupsArgs args, InvokeOptions options)
public static Output<GetNsGroupsResult> getNsGroups(GetNsGroupsArgs args, InvokeOptions options)
fn::invoke:
function: nsxt:index/getNsGroups:getNsGroups
arguments:
# arguments dictionaryThe following arguments are supported:
- Id string
- Id string
- id String
- id string
- id str
- id String
getNsGroups Result
The following output properties are available:
Package Details
- Repository
- nsxt vmware/terraform-provider-nsxt
- License
- Notes
- This Pulumi package is based on the
nsxtTerraform Provider.
Viewing docs for nsxt 3.11.0
published on Monday, Dec 15, 2025 by vmware
published on Monday, Dec 15, 2025 by vmware
