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

vcd logo
vcd 3.14.1 published on Monday, Apr 14, 2025 by vmware

    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",
    }));
    
    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")
    
    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
    	})
    }
    
    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",
        });
    
    });
    
    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());
    
        }
    }
    
    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
    

    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>
    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]
    func LookupNsxtSecurityGroup(ctx *Context, args *LookupNsxtSecurityGroupArgs, opts ...InvokeOption) (*LookupNsxtSecurityGroupResult, error)
    func LookupNsxtSecurityGroupOutput(ctx *Context, args *LookupNsxtSecurityGroupOutputArgs, opts ...InvokeOption) LookupNsxtSecurityGroupResultOutput

    > 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)
    }
    public static CompletableFuture<GetNsxtSecurityGroupResult> getNsxtSecurityGroup(GetNsxtSecurityGroupArgs args, InvokeOptions options)
    public static Output<GetNsxtSecurityGroupResult> getNsxtSecurityGroup(GetNsxtSecurityGroupArgs args, InvokeOptions options)
    
    fn::invoke:
      function: vcd:index/getNsxtSecurityGroup:getNsxtSecurityGroup
      arguments:
        # arguments dictionary

    The following arguments are supported:

    EdgeGatewayId string
    The ID of the Edge Gateway (NSX-T only). Can be looked up using
    Name 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 string
    The ID of the Edge Gateway (NSX-T only). Can be looked up using
    Name 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 String
    The ID of the Edge Gateway (NSX-T only). Can be looked up using
    name 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 string
    The ID of the Edge Gateway (NSX-T only). Can be looked up using
    name 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 str
    The ID of the Edge Gateway (NSX-T only). Can be looked up using
    name 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 String
    The ID of the Edge Gateway (NSX-T only). Can be looked up using
    name 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 string
    VappName string
    VmId string
    VmName string
    VappId string
    VappName string
    VmId string
    VmName string
    vappId String
    vappName String
    vmId String
    vmName String
    vappId string
    vappName string
    vmId string
    vmName string
    vappId String
    vappName String
    vmId String
    vmName String

    Package Details

    Repository
    vcd vmware/terraform-provider-vcd
    License
    Notes
    This Pulumi package is based on the vcd Terraform Provider.
    vcd logo
    vcd 3.14.1 published on Monday, Apr 14, 2025 by vmware