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

vcd.getNsxtDynamicSecurityGroup

Explore with Pulumi AI

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

    Supported in provider v3.7+ and VCD 10.3+ with NSX-T backed VDC Groups.

    Provides a data source to read NSX-T Dynamic Security Groups. Dynamic Security Groups group Virtual Machines based on specific criteria (VM Names or Security tags) to which Distributed Firewall Rules apply.

    Example Usage

    1 (Existing Dynamic Security Group Lookup)

    import * as pulumi from "@pulumi/pulumi";
    import * as vcd from "@pulumi/vcd";
    
    const group1VdcGroup = vcd.getVdcGroup({
        org: "cloud",
        name: "vdc-group-cloud",
    });
    const group1NsxtDynamicSecurityGroup = group1VdcGroup.then(group1VdcGroup => vcd.getNsxtDynamicSecurityGroup({
        org: "cloud",
        vdcGroupId: group1VdcGroup.id,
        name: "cloud-dynamic-security-group",
    }));
    
    import pulumi
    import pulumi_vcd as vcd
    
    group1_vdc_group = vcd.get_vdc_group(org="cloud",
        name="vdc-group-cloud")
    group1_nsxt_dynamic_security_group = vcd.get_nsxt_dynamic_security_group(org="cloud",
        vdc_group_id=group1_vdc_group.id,
        name="cloud-dynamic-security-group")
    
    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 {
    		group1VdcGroup, err := vcd.LookupVdcGroup(ctx, &vcd.LookupVdcGroupArgs{
    			Org:  pulumi.StringRef("cloud"),
    			Name: pulumi.StringRef("vdc-group-cloud"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = vcd.LookupNsxtDynamicSecurityGroup(ctx, &vcd.LookupNsxtDynamicSecurityGroupArgs{
    			Org:        pulumi.StringRef("cloud"),
    			VdcGroupId: group1VdcGroup.Id,
    			Name:       "cloud-dynamic-security-group",
    		}, 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 group1VdcGroup = Vcd.GetVdcGroup.Invoke(new()
        {
            Org = "cloud",
            Name = "vdc-group-cloud",
        });
    
        var group1NsxtDynamicSecurityGroup = Vcd.GetNsxtDynamicSecurityGroup.Invoke(new()
        {
            Org = "cloud",
            VdcGroupId = group1VdcGroup.Apply(getVdcGroupResult => getVdcGroupResult.Id),
            Name = "cloud-dynamic-security-group",
        });
    
    });
    
    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.GetVdcGroupArgs;
    import com.pulumi.vcd.inputs.GetNsxtDynamicSecurityGroupArgs;
    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 group1VdcGroup = VcdFunctions.getVdcGroup(GetVdcGroupArgs.builder()
                .org("cloud")
                .name("vdc-group-cloud")
                .build());
    
            final var group1NsxtDynamicSecurityGroup = VcdFunctions.getNsxtDynamicSecurityGroup(GetNsxtDynamicSecurityGroupArgs.builder()
                .org("cloud")
                .vdcGroupId(group1VdcGroup.applyValue(getVdcGroupResult -> getVdcGroupResult.id()))
                .name("cloud-dynamic-security-group")
                .build());
    
        }
    }
    
    variables:
      group1VdcGroup:
        fn::invoke:
          function: vcd:getVdcGroup
          arguments:
            org: cloud
            name: vdc-group-cloud
      group1NsxtDynamicSecurityGroup:
        fn::invoke:
          function: vcd:getNsxtDynamicSecurityGroup
          arguments:
            org: cloud
            vdcGroupId: ${group1VdcGroup.id}
            name: cloud-dynamic-security-group
    

    Using getNsxtDynamicSecurityGroup

    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 getNsxtDynamicSecurityGroup(args: GetNsxtDynamicSecurityGroupArgs, opts?: InvokeOptions): Promise<GetNsxtDynamicSecurityGroupResult>
    function getNsxtDynamicSecurityGroupOutput(args: GetNsxtDynamicSecurityGroupOutputArgs, opts?: InvokeOptions): Output<GetNsxtDynamicSecurityGroupResult>
    def get_nsxt_dynamic_security_group(description: Optional[str] = None,
                                        id: Optional[str] = None,
                                        name: Optional[str] = None,
                                        org: Optional[str] = None,
                                        vdc_group_id: Optional[str] = None,
                                        opts: Optional[InvokeOptions] = None) -> GetNsxtDynamicSecurityGroupResult
    def get_nsxt_dynamic_security_group_output(description: Optional[pulumi.Input[str]] = None,
                                        id: Optional[pulumi.Input[str]] = None,
                                        name: Optional[pulumi.Input[str]] = None,
                                        org: Optional[pulumi.Input[str]] = None,
                                        vdc_group_id: Optional[pulumi.Input[str]] = None,
                                        opts: Optional[InvokeOptions] = None) -> Output[GetNsxtDynamicSecurityGroupResult]
    func LookupNsxtDynamicSecurityGroup(ctx *Context, args *LookupNsxtDynamicSecurityGroupArgs, opts ...InvokeOption) (*LookupNsxtDynamicSecurityGroupResult, error)
    func LookupNsxtDynamicSecurityGroupOutput(ctx *Context, args *LookupNsxtDynamicSecurityGroupOutputArgs, opts ...InvokeOption) LookupNsxtDynamicSecurityGroupResultOutput

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

    public static class GetNsxtDynamicSecurityGroup 
    {
        public static Task<GetNsxtDynamicSecurityGroupResult> InvokeAsync(GetNsxtDynamicSecurityGroupArgs args, InvokeOptions? opts = null)
        public static Output<GetNsxtDynamicSecurityGroupResult> Invoke(GetNsxtDynamicSecurityGroupInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetNsxtDynamicSecurityGroupResult> getNsxtDynamicSecurityGroup(GetNsxtDynamicSecurityGroupArgs args, InvokeOptions options)
    public static Output<GetNsxtDynamicSecurityGroupResult> getNsxtDynamicSecurityGroup(GetNsxtDynamicSecurityGroupArgs args, InvokeOptions options)
    
    fn::invoke:
      function: vcd:index/getNsxtDynamicSecurityGroup:getNsxtDynamicSecurityGroup
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Name string

    A unique name for existing Dynamic Security Group

    All the arguments and attributes defined in vcd.NsxtDynamicSecurityGroup resource are available.

    VdcGroupId string
    VDC Group ID hosting existing Dynamic Security Group.
    Description string
    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.
    Name string

    A unique name for existing Dynamic Security Group

    All the arguments and attributes defined in vcd.NsxtDynamicSecurityGroup resource are available.

    VdcGroupId string
    VDC Group ID hosting existing Dynamic Security Group.
    Description string
    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.
    name String

    A unique name for existing Dynamic Security Group

    All the arguments and attributes defined in vcd.NsxtDynamicSecurityGroup resource are available.

    vdcGroupId String
    VDC Group ID hosting existing Dynamic Security Group.
    description String
    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.
    name string

    A unique name for existing Dynamic Security Group

    All the arguments and attributes defined in vcd.NsxtDynamicSecurityGroup resource are available.

    vdcGroupId string
    VDC Group ID hosting existing Dynamic Security Group.
    description string
    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.
    name str

    A unique name for existing Dynamic Security Group

    All the arguments and attributes defined in vcd.NsxtDynamicSecurityGroup resource are available.

    vdc_group_id str
    VDC Group ID hosting existing Dynamic Security Group.
    description str
    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.
    name String

    A unique name for existing Dynamic Security Group

    All the arguments and attributes defined in vcd.NsxtDynamicSecurityGroup resource are available.

    vdcGroupId String
    VDC Group ID hosting existing Dynamic Security Group.
    description String
    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.

    getNsxtDynamicSecurityGroup Result

    The following output properties are available:

    Supporting Types

    GetNsxtDynamicSecurityGroupCriteria

    GetNsxtDynamicSecurityGroupCriteriaRule

    Operator string
    Type string
    Value string
    Operator string
    Type string
    Value string
    operator String
    type String
    value String
    operator string
    type string
    value string
    operator str
    type str
    value str
    operator String
    type String
    value String

    GetNsxtDynamicSecurityGroupMemberVm

    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