1. Packages
  2. Vcd Provider
  3. API Docs
  4. getNsxtSecurityGroup
vcd 3.14.1 published on Monday, Apr 14, 2025 by vmware

vcd.getNsxtSecurityGroup

Explore with Pulumi AI

Supported in provider v3.3+ and VCD 10.1+ with NSX-T backed VDCs.

Provides a data source to access NSX-T Security Group configuration. Security Groups are groups of data center group networks to which distributed firewall rules apply. Grouping networks helps you to reduce the total number of distributed firewall rules to be created.

Example Usage

1

import * as pulumi from "@pulumi/pulumi";
import * as vcd from "@pulumi/vcd";

const main = vcd.getNsxtEdgegateway({
    org: "my-org",
    name: "main-edge",
});
const group1 = main.then(main => vcd.getNsxtSecurityGroup({
    org: "my-org",
    edgeGatewayId: main.id,
    name: "test-security-group-changed",
}));
Copy
import pulumi
import pulumi_vcd as vcd

main = vcd.get_nsxt_edgegateway(org="my-org",
    name="main-edge")
group1 = vcd.get_nsxt_security_group(org="my-org",
    edge_gateway_id=main.id,
    name="test-security-group-changed")
Copy
package main

import (
	"github.com/pulumi/pulumi-terraform-provider/sdks/go/vcd/v3/vcd"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		main, err := vcd.LookupNsxtEdgegateway(ctx, &vcd.LookupNsxtEdgegatewayArgs{
			Org:  pulumi.StringRef("my-org"),
			Name: "main-edge",
		}, nil)
		if err != nil {
			return err
		}
		_, err = vcd.LookupNsxtSecurityGroup(ctx, &vcd.LookupNsxtSecurityGroupArgs{
			Org:           pulumi.StringRef("my-org"),
			EdgeGatewayId: main.Id,
			Name:          "test-security-group-changed",
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Vcd = Pulumi.Vcd;

return await Deployment.RunAsync(() => 
{
    var main = Vcd.GetNsxtEdgegateway.Invoke(new()
    {
        Org = "my-org",
        Name = "main-edge",
    });

    var group1 = Vcd.GetNsxtSecurityGroup.Invoke(new()
    {
        Org = "my-org",
        EdgeGatewayId = main.Apply(getNsxtEdgegatewayResult => getNsxtEdgegatewayResult.Id),
        Name = "test-security-group-changed",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.vcd.VcdFunctions;
import com.pulumi.vcd.inputs.GetNsxtEdgegatewayArgs;
import com.pulumi.vcd.inputs.GetNsxtSecurityGroupArgs;
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 main = VcdFunctions.getNsxtEdgegateway(GetNsxtEdgegatewayArgs.builder()
            .org("my-org")
            .name("main-edge")
            .build());

        final var group1 = VcdFunctions.getNsxtSecurityGroup(GetNsxtSecurityGroupArgs.builder()
            .org("my-org")
            .edgeGatewayId(main.applyValue(getNsxtEdgegatewayResult -> getNsxtEdgegatewayResult.id()))
            .name("test-security-group-changed")
            .build());

    }
}
Copy
variables:
  main:
    fn::invoke:
      function: vcd:getNsxtEdgegateway
      arguments:
        org: my-org
        name: main-edge
  group1:
    fn::invoke:
      function: vcd:getNsxtSecurityGroup
      arguments:
        org: my-org
        edgeGatewayId: ${main.id}
        name: test-security-group-changed
Copy

Using getNsxtSecurityGroup

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 getNsxtSecurityGroup(args: GetNsxtSecurityGroupArgs, opts?: InvokeOptions): Promise<GetNsxtSecurityGroupResult>
function getNsxtSecurityGroupOutput(args: GetNsxtSecurityGroupOutputArgs, opts?: InvokeOptions): Output<GetNsxtSecurityGroupResult>
Copy
def get_nsxt_security_group(edge_gateway_id: Optional[str] = None,
                            id: Optional[str] = None,
                            name: Optional[str] = None,
                            org: Optional[str] = None,
                            vdc: Optional[str] = None,
                            opts: Optional[InvokeOptions] = None) -> GetNsxtSecurityGroupResult
def get_nsxt_security_group_output(edge_gateway_id: Optional[pulumi.Input[str]] = None,
                            id: Optional[pulumi.Input[str]] = None,
                            name: Optional[pulumi.Input[str]] = None,
                            org: Optional[pulumi.Input[str]] = None,
                            vdc: Optional[pulumi.Input[str]] = None,
                            opts: Optional[InvokeOptions] = None) -> Output[GetNsxtSecurityGroupResult]
Copy
func LookupNsxtSecurityGroup(ctx *Context, args *LookupNsxtSecurityGroupArgs, opts ...InvokeOption) (*LookupNsxtSecurityGroupResult, error)
func LookupNsxtSecurityGroupOutput(ctx *Context, args *LookupNsxtSecurityGroupOutputArgs, opts ...InvokeOption) LookupNsxtSecurityGroupResultOutput
Copy

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

public static class GetNsxtSecurityGroup 
{
    public static Task<GetNsxtSecurityGroupResult> InvokeAsync(GetNsxtSecurityGroupArgs args, InvokeOptions? opts = null)
    public static Output<GetNsxtSecurityGroupResult> Invoke(GetNsxtSecurityGroupInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetNsxtSecurityGroupResult> getNsxtSecurityGroup(GetNsxtSecurityGroupArgs args, InvokeOptions options)
public static Output<GetNsxtSecurityGroupResult> getNsxtSecurityGroup(GetNsxtSecurityGroupArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: vcd:index/getNsxtSecurityGroup:getNsxtSecurityGroup
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

EdgeGatewayId This property is required. string
The ID of the Edge Gateway (NSX-T only). Can be looked up using
Name This property is required. string
Unique name of existing Security Group.
Id string
Org string
The name of organization to use, optional if defined at provider level. Useful when connected as sysadmin working across different organisations.
Vdc string
The name of VDC to use, optional if defined at provider level. Deprecated in favor of edge_gateway_id field.

Deprecated: Deprecated

EdgeGatewayId This property is required. string
The ID of the Edge Gateway (NSX-T only). Can be looked up using
Name This property is required. string
Unique name of existing Security Group.
Id string
Org string
The name of organization to use, optional if defined at provider level. Useful when connected as sysadmin working across different organisations.
Vdc string
The name of VDC to use, optional if defined at provider level. Deprecated in favor of edge_gateway_id field.

Deprecated: Deprecated

edgeGatewayId This property is required. String
The ID of the Edge Gateway (NSX-T only). Can be looked up using
name This property is required. String
Unique name of existing Security Group.
id String
org String
The name of organization to use, optional if defined at provider level. Useful when connected as sysadmin working across different organisations.
vdc String
The name of VDC to use, optional if defined at provider level. Deprecated in favor of edge_gateway_id field.

Deprecated: Deprecated

edgeGatewayId This property is required. string
The ID of the Edge Gateway (NSX-T only). Can be looked up using
name This property is required. string
Unique name of existing Security Group.
id string
org string
The name of organization to use, optional if defined at provider level. Useful when connected as sysadmin working across different organisations.
vdc string
The name of VDC to use, optional if defined at provider level. Deprecated in favor of edge_gateway_id field.

Deprecated: Deprecated

edge_gateway_id This property is required. str
The ID of the Edge Gateway (NSX-T only). Can be looked up using
name This property is required. str
Unique name of existing Security Group.
id str
org str
The name of organization to use, optional if defined at provider level. Useful when connected as sysadmin working across different organisations.
vdc str
The name of VDC to use, optional if defined at provider level. Deprecated in favor of edge_gateway_id field.

Deprecated: Deprecated

edgeGatewayId This property is required. String
The ID of the Edge Gateway (NSX-T only). Can be looked up using
name This property is required. String
Unique name of existing Security Group.
id String
org String
The name of organization to use, optional if defined at provider level. Useful when connected as sysadmin working across different organisations.
vdc String
The name of VDC to use, optional if defined at provider level. Deprecated in favor of edge_gateway_id field.

Deprecated: Deprecated

getNsxtSecurityGroup Result

The following output properties are available:

Description string
EdgeGatewayId string
Id string
MemberOrgNetworkIds List<string>
MemberVms List<GetNsxtSecurityGroupMemberVm>
Name string
OwnerId string
Parent VDC or VDC Group ID.
Org string
Vdc string

Deprecated: Deprecated

Description string
EdgeGatewayId string
Id string
MemberOrgNetworkIds []string
MemberVms []GetNsxtSecurityGroupMemberVm
Name string
OwnerId string
Parent VDC or VDC Group ID.
Org string
Vdc string

Deprecated: Deprecated

description String
edgeGatewayId String
id String
memberOrgNetworkIds List<String>
memberVms List<GetNsxtSecurityGroupMemberVm>
name String
ownerId String
Parent VDC or VDC Group ID.
org String
vdc String

Deprecated: Deprecated

description string
edgeGatewayId string
id string
memberOrgNetworkIds string[]
memberVms GetNsxtSecurityGroupMemberVm[]
name string
ownerId string
Parent VDC or VDC Group ID.
org string
vdc string

Deprecated: Deprecated

description str
edge_gateway_id str
id str
member_org_network_ids Sequence[str]
member_vms Sequence[GetNsxtSecurityGroupMemberVm]
name str
owner_id str
Parent VDC or VDC Group ID.
org str
vdc str

Deprecated: Deprecated

description String
edgeGatewayId String
id String
memberOrgNetworkIds List<String>
memberVms List<Property Map>
name String
ownerId String
Parent VDC or VDC Group ID.
org String
vdc String

Deprecated: Deprecated

Supporting Types

GetNsxtSecurityGroupMemberVm

VappId This property is required. string
VappName This property is required. string
VmId This property is required. string
VmName This property is required. string
VappId This property is required. string
VappName This property is required. string
VmId This property is required. string
VmName This property is required. string
vappId This property is required. String
vappName This property is required. String
vmId This property is required. String
vmName This property is required. String
vappId This property is required. string
vappName This property is required. string
vmId This property is required. string
vmName This property is required. string
vapp_id This property is required. str
vapp_name This property is required. str
vm_id This property is required. str
vm_name This property is required. str
vappId This property is required. String
vappName This property is required. String
vmId This property is required. String
vmName This property is required. String

Package Details

Repository
vcd vmware/terraform-provider-vcd
License
Notes
This Pulumi package is based on the vcd Terraform Provider.