1. Packages
  2. Vra Provider
  3. API Docs
  4. getSecurityGroup
vra 0.12.0 published on Monday, Apr 14, 2025 by vmware

vra.getSecurityGroup

Explore with Pulumi AI

vra logo
vra 0.12.0 published on Monday, Apr 14, 2025 by vmware

    Example Usage

    S

    This is an example of how to lookup security groups.

    Security groups by filter query:

    import * as pulumi from "@pulumi/pulumi";
    import * as vra from "@pulumi/vra";
    
    const _this = vra.getSecurityGroup({
        filter: `name eq '${_var.name}'`,
    });
    
    import pulumi
    import pulumi_vra as vra
    
    this = vra.get_security_group(filter=f"name eq '{var['name']}'")
    
    package main
    
    import (
    	"fmt"
    
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/vra/vra"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := vra.GetSecurityGroup(ctx, &vra.GetSecurityGroupArgs{
    			Filter: fmt.Sprintf("name eq '%v'", _var.Name),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Vra = Pulumi.Vra;
    
    return await Deployment.RunAsync(() => 
    {
        var @this = Vra.GetSecurityGroup.Invoke(new()
        {
            Filter = $"name eq '{@var.Name}'",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.vra.VraFunctions;
    import com.pulumi.vra.inputs.GetSecurityGroupArgs;
    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 this = VraFunctions.getSecurityGroup(GetSecurityGroupArgs.builder()
                .filter(String.format("name eq '%s'", var_.name()))
                .build());
    
        }
    }
    
    variables:
      this:
        fn::invoke:
          function: vra:getSecurityGroup
          arguments:
            filter: name eq '${var.name}'
    

    A Security group supports the following arguments:

    Using getSecurityGroup

    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 getSecurityGroup(args: GetSecurityGroupArgs, opts?: InvokeOptions): Promise<GetSecurityGroupResult>
    function getSecurityGroupOutput(args: GetSecurityGroupOutputArgs, opts?: InvokeOptions): Output<GetSecurityGroupResult>
    def get_security_group(filter: Optional[str] = None,
                           rules: Optional[Sequence[GetSecurityGroupRule]] = None,
                           opts: Optional[InvokeOptions] = None) -> GetSecurityGroupResult
    def get_security_group_output(filter: Optional[pulumi.Input[str]] = None,
                           rules: Optional[pulumi.Input[Sequence[pulumi.Input[GetSecurityGroupRuleArgs]]]] = None,
                           opts: Optional[InvokeOptions] = None) -> Output[GetSecurityGroupResult]
    func GetSecurityGroup(ctx *Context, args *GetSecurityGroupArgs, opts ...InvokeOption) (*GetSecurityGroupResult, error)
    func GetSecurityGroupOutput(ctx *Context, args *GetSecurityGroupOutputArgs, opts ...InvokeOption) GetSecurityGroupResultOutput

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

    public static class GetSecurityGroup 
    {
        public static Task<GetSecurityGroupResult> InvokeAsync(GetSecurityGroupArgs args, InvokeOptions? opts = null)
        public static Output<GetSecurityGroupResult> Invoke(GetSecurityGroupInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetSecurityGroupResult> getSecurityGroup(GetSecurityGroupArgs args, InvokeOptions options)
    public static Output<GetSecurityGroupResult> getSecurityGroup(GetSecurityGroupArgs args, InvokeOptions options)
    
    fn::invoke:
      function: vra:index/getSecurityGroup:getSecurityGroup
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Filter string
    Search criteria to narrow down the Security groups.
    Rules List<GetSecurityGroupRule>
    List of security rules.
    Filter string
    Search criteria to narrow down the Security groups.
    Rules []GetSecurityGroupRule
    List of security rules.
    filter String
    Search criteria to narrow down the Security groups.
    rules List<GetSecurityGroupRule>
    List of security rules.
    filter string
    Search criteria to narrow down the Security groups.
    rules GetSecurityGroupRule[]
    List of security rules.
    filter str
    Search criteria to narrow down the Security groups.
    rules Sequence[GetSecurityGroupRule]
    List of security rules.
    filter String
    Search criteria to narrow down the Security groups.
    rules List<Property Map>
    List of security rules.

    getSecurityGroup Result

    The following output properties are available:

    CreatedAt string
    Date when the entity was created. The date is in ISO 6801 and UTC.
    Description string
    A human-friendly description of the security groups.
    ExternalId string
    External entity Id on the provider side.
    ExternalRegionId string
    The id of the region for which this entity is defined.
    Filter string
    Id string
    ID of the security group.
    Links List<GetSecurityGroupLink>
    HATEOAS of the entity
    Name string
    Name of the security group.
    OrganizationId string
    ID of organization that entity belongs to.
    Owner string
    UpdatedAt string
    Date when the entity was last updated. The date is ISO 8601 and UTC.
    Rules List<GetSecurityGroupRule>
    List of security rules.
    CreatedAt string
    Date when the entity was created. The date is in ISO 6801 and UTC.
    Description string
    A human-friendly description of the security groups.
    ExternalId string
    External entity Id on the provider side.
    ExternalRegionId string
    The id of the region for which this entity is defined.
    Filter string
    Id string
    ID of the security group.
    Links []GetSecurityGroupLink
    HATEOAS of the entity
    Name string
    Name of the security group.
    OrganizationId string
    ID of organization that entity belongs to.
    Owner string
    UpdatedAt string
    Date when the entity was last updated. The date is ISO 8601 and UTC.
    Rules []GetSecurityGroupRule
    List of security rules.
    createdAt String
    Date when the entity was created. The date is in ISO 6801 and UTC.
    description String
    A human-friendly description of the security groups.
    externalId String
    External entity Id on the provider side.
    externalRegionId String
    The id of the region for which this entity is defined.
    filter String
    id String
    ID of the security group.
    links List<GetSecurityGroupLink>
    HATEOAS of the entity
    name String
    Name of the security group.
    organizationId String
    ID of organization that entity belongs to.
    owner String
    updatedAt String
    Date when the entity was last updated. The date is ISO 8601 and UTC.
    rules List<GetSecurityGroupRule>
    List of security rules.
    createdAt string
    Date when the entity was created. The date is in ISO 6801 and UTC.
    description string
    A human-friendly description of the security groups.
    externalId string
    External entity Id on the provider side.
    externalRegionId string
    The id of the region for which this entity is defined.
    filter string
    id string
    ID of the security group.
    links GetSecurityGroupLink[]
    HATEOAS of the entity
    name string
    Name of the security group.
    organizationId string
    ID of organization that entity belongs to.
    owner string
    updatedAt string
    Date when the entity was last updated. The date is ISO 8601 and UTC.
    rules GetSecurityGroupRule[]
    List of security rules.
    created_at str
    Date when the entity was created. The date is in ISO 6801 and UTC.
    description str
    A human-friendly description of the security groups.
    external_id str
    External entity Id on the provider side.
    external_region_id str
    The id of the region for which this entity is defined.
    filter str
    id str
    ID of the security group.
    links Sequence[GetSecurityGroupLink]
    HATEOAS of the entity
    name str
    Name of the security group.
    organization_id str
    ID of organization that entity belongs to.
    owner str
    updated_at str
    Date when the entity was last updated. The date is ISO 8601 and UTC.
    rules Sequence[GetSecurityGroupRule]
    List of security rules.
    createdAt String
    Date when the entity was created. The date is in ISO 6801 and UTC.
    description String
    A human-friendly description of the security groups.
    externalId String
    External entity Id on the provider side.
    externalRegionId String
    The id of the region for which this entity is defined.
    filter String
    id String
    ID of the security group.
    links List<Property Map>
    HATEOAS of the entity
    name String
    Name of the security group.
    organizationId String
    ID of organization that entity belongs to.
    owner String
    updatedAt String
    Date when the entity was last updated. The date is ISO 8601 and UTC.
    rules List<Property Map>
    List of security rules.

    Supporting Types

    Href string
    Hrefs List<string>
    Rel string
    Href string
    Hrefs []string
    Rel string
    href String
    hrefs List<String>
    rel String
    href string
    hrefs string[]
    rel string
    href str
    hrefs Sequence[str]
    rel str
    href String
    hrefs List<String>
    rel String

    GetSecurityGroupRule

    Access string
    Direction string
    IpRangeCidr double
    Ports string
    Protocol string
    Name string
    Name of the security group.
    Service string
    Access string
    Direction string
    IpRangeCidr float64
    Ports string
    Protocol string
    Name string
    Name of the security group.
    Service string
    access String
    direction String
    ipRangeCidr Double
    ports String
    protocol String
    name String
    Name of the security group.
    service String
    access string
    direction string
    ipRangeCidr number
    ports string
    protocol string
    name string
    Name of the security group.
    service string
    access str
    direction str
    ip_range_cidr float
    ports str
    protocol str
    name str
    Name of the security group.
    service str
    access String
    direction String
    ipRangeCidr Number
    ports String
    protocol String
    name String
    Name of the security group.
    service String

    Package Details

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