vra 0.12.0 published on Monday, Apr 14, 2025 by vmware
vra.getSecurityGroup
Explore with Pulumi AI
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 dictionaryThe following arguments are supported:
- Filter string
- Search criteria to narrow down the Security groups.
- Rules
List<GetSecurity Group Rule> 
- List of security rules.
- Filter string
- Search criteria to narrow down the Security groups.
- Rules
[]GetSecurity Group Rule 
- List of security rules.
- filter String
- Search criteria to narrow down the Security groups.
- rules
List<GetSecurity Group Rule> 
- List of security rules.
- filter string
- Search criteria to narrow down the Security groups.
- rules
GetSecurity Group Rule[] 
- List of security rules.
- filter str
- Search criteria to narrow down the Security groups.
- rules
Sequence[GetSecurity Group Rule] 
- 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.
- ExternalRegion stringId 
- The id of the region for which this entity is defined.
- Filter string
- Id string
- ID of the security group.
- Links
List<GetSecurity Group Link> 
- 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<GetSecurity Group Rule> 
- 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.
- ExternalRegion stringId 
- The id of the region for which this entity is defined.
- Filter string
- Id string
- ID of the security group.
- Links
[]GetSecurity Group Link 
- 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
[]GetSecurity Group Rule 
- 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.
- externalRegion StringId 
- The id of the region for which this entity is defined.
- filter String
- id String
- ID of the security group.
- links
List<GetSecurity Group Link> 
- 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<GetSecurity Group Rule> 
- 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.
- externalRegion stringId 
- The id of the region for which this entity is defined.
- filter string
- id string
- ID of the security group.
- links
GetSecurity Group Link[] 
- 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
GetSecurity Group Rule[] 
- 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_ strid 
- The id of the region for which this entity is defined.
- filter str
- id str
- ID of the security group.
- links
Sequence[GetSecurity Group Link] 
- 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[GetSecurity Group Rule] 
- 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.
- externalRegion StringId 
- 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
GetSecurityGroupLink   
GetSecurityGroupRule   
Package Details
- Repository
- vra vmware/terraform-provider-vra
- License
- Notes
- This Pulumi package is based on the vraTerraform Provider.