1. Packages
  2. Volcengine
  3. API Docs
  4. vpc
  5. getSecurityGroups
Volcengine v0.0.31 published on Monday, May 12, 2025 by Volcengine

volcengine.vpc.getSecurityGroups

Explore with Pulumi AI

volcengine logo
Volcengine v0.0.31 published on Monday, May 12, 2025 by Volcengine

    Use this data source to query detailed information of security groups

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as volcengine from "@pulumi/volcengine";
    
    const default = volcengine.vpc.getSecurityGroups({
        ids: ["sg-273ycgql3ig3k7fap8t3dyvqx"],
    });
    
    import pulumi
    import pulumi_volcengine as volcengine
    
    default = volcengine.vpc.get_security_groups(ids=["sg-273ycgql3ig3k7fap8t3dyvqx"])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/volcengine/pulumi-volcengine/sdk/go/volcengine/vpc"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := vpc.GetSecurityGroups(ctx, &vpc.GetSecurityGroupsArgs{
    			Ids: []string{
    				"sg-273ycgql3ig3k7fap8t3dyvqx",
    			},
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Volcengine = Pulumi.Volcengine;
    
    return await Deployment.RunAsync(() => 
    {
        var @default = Volcengine.Vpc.GetSecurityGroups.Invoke(new()
        {
            Ids = new[]
            {
                "sg-273ycgql3ig3k7fap8t3dyvqx",
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.volcengine.vpc.VpcFunctions;
    import com.pulumi.volcengine.vpc.inputs.GetSecurityGroupsArgs;
    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 default = VpcFunctions.getSecurityGroups(GetSecurityGroupsArgs.builder()
                .ids("sg-273ycgql3ig3k7fap8t3dyvqx")
                .build());
    
        }
    }
    
    variables:
      default:
        fn::invoke:
          Function: volcengine:vpc:getSecurityGroups
          Arguments:
            ids:
              - sg-273ycgql3ig3k7fap8t3dyvqx
    

    Using getSecurityGroups

    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 getSecurityGroups(args: GetSecurityGroupsArgs, opts?: InvokeOptions): Promise<GetSecurityGroupsResult>
    function getSecurityGroupsOutput(args: GetSecurityGroupsOutputArgs, opts?: InvokeOptions): Output<GetSecurityGroupsResult>
    def get_security_groups(ids: Optional[Sequence[str]] = None,
                            name_regex: Optional[str] = None,
                            output_file: Optional[str] = None,
                            project_name: Optional[str] = None,
                            security_group_names: Optional[Sequence[str]] = None,
                            tags: Optional[Sequence[GetSecurityGroupsTag]] = None,
                            vpc_id: Optional[str] = None,
                            opts: Optional[InvokeOptions] = None) -> GetSecurityGroupsResult
    def get_security_groups_output(ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                            name_regex: Optional[pulumi.Input[str]] = None,
                            output_file: Optional[pulumi.Input[str]] = None,
                            project_name: Optional[pulumi.Input[str]] = None,
                            security_group_names: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                            tags: Optional[pulumi.Input[Sequence[pulumi.Input[GetSecurityGroupsTagArgs]]]] = None,
                            vpc_id: Optional[pulumi.Input[str]] = None,
                            opts: Optional[InvokeOptions] = None) -> Output[GetSecurityGroupsResult]
    func GetSecurityGroups(ctx *Context, args *GetSecurityGroupsArgs, opts ...InvokeOption) (*GetSecurityGroupsResult, error)
    func GetSecurityGroupsOutput(ctx *Context, args *GetSecurityGroupsOutputArgs, opts ...InvokeOption) GetSecurityGroupsResultOutput

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

    public static class GetSecurityGroups 
    {
        public static Task<GetSecurityGroupsResult> InvokeAsync(GetSecurityGroupsArgs args, InvokeOptions? opts = null)
        public static Output<GetSecurityGroupsResult> Invoke(GetSecurityGroupsInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetSecurityGroupsResult> getSecurityGroups(GetSecurityGroupsArgs args, InvokeOptions options)
    public static Output<GetSecurityGroupsResult> getSecurityGroups(GetSecurityGroupsArgs args, InvokeOptions options)
    
    fn::invoke:
      function: volcengine:vpc/getSecurityGroups:getSecurityGroups
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Ids List<string>
    A list of SecurityGroup IDs.
    NameRegex string
    A Name Regex of SecurityGroup.
    OutputFile string
    File name where to save data source results.
    ProjectName string
    The ProjectName of SecurityGroup.
    SecurityGroupNames List<string>
    The list of security group name to query.
    Tags List<GetSecurityGroupsTag>
    Tags.
    VpcId string
    The ID of vpc where security group is located.
    Ids []string
    A list of SecurityGroup IDs.
    NameRegex string
    A Name Regex of SecurityGroup.
    OutputFile string
    File name where to save data source results.
    ProjectName string
    The ProjectName of SecurityGroup.
    SecurityGroupNames []string
    The list of security group name to query.
    Tags []GetSecurityGroupsTag
    Tags.
    VpcId string
    The ID of vpc where security group is located.
    ids List<String>
    A list of SecurityGroup IDs.
    nameRegex String
    A Name Regex of SecurityGroup.
    outputFile String
    File name where to save data source results.
    projectName String
    The ProjectName of SecurityGroup.
    securityGroupNames List<String>
    The list of security group name to query.
    tags List<GetSecurityGroupsTag>
    Tags.
    vpcId String
    The ID of vpc where security group is located.
    ids string[]
    A list of SecurityGroup IDs.
    nameRegex string
    A Name Regex of SecurityGroup.
    outputFile string
    File name where to save data source results.
    projectName string
    The ProjectName of SecurityGroup.
    securityGroupNames string[]
    The list of security group name to query.
    tags GetSecurityGroupsTag[]
    Tags.
    vpcId string
    The ID of vpc where security group is located.
    ids Sequence[str]
    A list of SecurityGroup IDs.
    name_regex str
    A Name Regex of SecurityGroup.
    output_file str
    File name where to save data source results.
    project_name str
    The ProjectName of SecurityGroup.
    security_group_names Sequence[str]
    The list of security group name to query.
    tags Sequence[GetSecurityGroupsTag]
    Tags.
    vpc_id str
    The ID of vpc where security group is located.
    ids List<String>
    A list of SecurityGroup IDs.
    nameRegex String
    A Name Regex of SecurityGroup.
    outputFile String
    File name where to save data source results.
    projectName String
    The ProjectName of SecurityGroup.
    securityGroupNames List<String>
    The list of security group name to query.
    tags List<Property Map>
    Tags.
    vpcId String
    The ID of vpc where security group is located.

    getSecurityGroups Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    SecurityGroups List<GetSecurityGroupsSecurityGroup>
    The collection of SecurityGroup query.
    TotalCount int
    The total count of SecurityGroup query.
    Ids List<string>
    NameRegex string
    OutputFile string
    ProjectName string
    The ProjectName of SecurityGroup.
    SecurityGroupNames List<string>
    Tags List<GetSecurityGroupsTag>
    Tags.
    VpcId string
    The ID of Vpc.
    Id string
    The provider-assigned unique ID for this managed resource.
    SecurityGroups []GetSecurityGroupsSecurityGroup
    The collection of SecurityGroup query.
    TotalCount int
    The total count of SecurityGroup query.
    Ids []string
    NameRegex string
    OutputFile string
    ProjectName string
    The ProjectName of SecurityGroup.
    SecurityGroupNames []string
    Tags []GetSecurityGroupsTag
    Tags.
    VpcId string
    The ID of Vpc.
    id String
    The provider-assigned unique ID for this managed resource.
    securityGroups List<GetSecurityGroupsSecurityGroup>
    The collection of SecurityGroup query.
    totalCount Integer
    The total count of SecurityGroup query.
    ids List<String>
    nameRegex String
    outputFile String
    projectName String
    The ProjectName of SecurityGroup.
    securityGroupNames List<String>
    tags List<GetSecurityGroupsTag>
    Tags.
    vpcId String
    The ID of Vpc.
    id string
    The provider-assigned unique ID for this managed resource.
    securityGroups GetSecurityGroupsSecurityGroup[]
    The collection of SecurityGroup query.
    totalCount number
    The total count of SecurityGroup query.
    ids string[]
    nameRegex string
    outputFile string
    projectName string
    The ProjectName of SecurityGroup.
    securityGroupNames string[]
    tags GetSecurityGroupsTag[]
    Tags.
    vpcId string
    The ID of Vpc.
    id str
    The provider-assigned unique ID for this managed resource.
    security_groups Sequence[GetSecurityGroupsSecurityGroup]
    The collection of SecurityGroup query.
    total_count int
    The total count of SecurityGroup query.
    ids Sequence[str]
    name_regex str
    output_file str
    project_name str
    The ProjectName of SecurityGroup.
    security_group_names Sequence[str]
    tags Sequence[GetSecurityGroupsTag]
    Tags.
    vpc_id str
    The ID of Vpc.
    id String
    The provider-assigned unique ID for this managed resource.
    securityGroups List<Property Map>
    The collection of SecurityGroup query.
    totalCount Number
    The total count of SecurityGroup query.
    ids List<String>
    nameRegex String
    outputFile String
    projectName String
    The ProjectName of SecurityGroup.
    securityGroupNames List<String>
    tags List<Property Map>
    Tags.
    vpcId String
    The ID of Vpc.

    Supporting Types

    GetSecurityGroupsSecurityGroup

    CreationTime string
    The creation time of SecurityGroup.
    Description string
    The description of SecurityGroup.
    Id string
    The ID of SecurityGroup.
    ProjectName string
    The ProjectName of SecurityGroup.
    SecurityGroupId string
    The ID of SecurityGroup.
    SecurityGroupName string
    The Name of SecurityGroup.
    Status string
    The Status of SecurityGroup.
    Tags List<GetSecurityGroupsSecurityGroupTag>
    Tags.
    Type string
    A Name Regex of SecurityGroup.
    VpcId string
    The ID of vpc where security group is located.
    CreationTime string
    The creation time of SecurityGroup.
    Description string
    The description of SecurityGroup.
    Id string
    The ID of SecurityGroup.
    ProjectName string
    The ProjectName of SecurityGroup.
    SecurityGroupId string
    The ID of SecurityGroup.
    SecurityGroupName string
    The Name of SecurityGroup.
    Status string
    The Status of SecurityGroup.
    Tags []GetSecurityGroupsSecurityGroupTag
    Tags.
    Type string
    A Name Regex of SecurityGroup.
    VpcId string
    The ID of vpc where security group is located.
    creationTime String
    The creation time of SecurityGroup.
    description String
    The description of SecurityGroup.
    id String
    The ID of SecurityGroup.
    projectName String
    The ProjectName of SecurityGroup.
    securityGroupId String
    The ID of SecurityGroup.
    securityGroupName String
    The Name of SecurityGroup.
    status String
    The Status of SecurityGroup.
    tags List<GetSecurityGroupsSecurityGroupTag>
    Tags.
    type String
    A Name Regex of SecurityGroup.
    vpcId String
    The ID of vpc where security group is located.
    creationTime string
    The creation time of SecurityGroup.
    description string
    The description of SecurityGroup.
    id string
    The ID of SecurityGroup.
    projectName string
    The ProjectName of SecurityGroup.
    securityGroupId string
    The ID of SecurityGroup.
    securityGroupName string
    The Name of SecurityGroup.
    status string
    The Status of SecurityGroup.
    tags GetSecurityGroupsSecurityGroupTag[]
    Tags.
    type string
    A Name Regex of SecurityGroup.
    vpcId string
    The ID of vpc where security group is located.
    creation_time str
    The creation time of SecurityGroup.
    description str
    The description of SecurityGroup.
    id str
    The ID of SecurityGroup.
    project_name str
    The ProjectName of SecurityGroup.
    security_group_id str
    The ID of SecurityGroup.
    security_group_name str
    The Name of SecurityGroup.
    status str
    The Status of SecurityGroup.
    tags Sequence[GetSecurityGroupsSecurityGroupTag]
    Tags.
    type str
    A Name Regex of SecurityGroup.
    vpc_id str
    The ID of vpc where security group is located.
    creationTime String
    The creation time of SecurityGroup.
    description String
    The description of SecurityGroup.
    id String
    The ID of SecurityGroup.
    projectName String
    The ProjectName of SecurityGroup.
    securityGroupId String
    The ID of SecurityGroup.
    securityGroupName String
    The Name of SecurityGroup.
    status String
    The Status of SecurityGroup.
    tags List<Property Map>
    Tags.
    type String
    A Name Regex of SecurityGroup.
    vpcId String
    The ID of vpc where security group is located.

    GetSecurityGroupsSecurityGroupTag

    Key string
    The Key of Tags.
    Value string
    The Value of Tags.
    Key string
    The Key of Tags.
    Value string
    The Value of Tags.
    key String
    The Key of Tags.
    value String
    The Value of Tags.
    key string
    The Key of Tags.
    value string
    The Value of Tags.
    key str
    The Key of Tags.
    value str
    The Value of Tags.
    key String
    The Key of Tags.
    value String
    The Value of Tags.

    GetSecurityGroupsTag

    Key string
    The Key of Tags.
    Value string
    The Value of Tags.
    Key string
    The Key of Tags.
    Value string
    The Value of Tags.
    key String
    The Key of Tags.
    value String
    The Value of Tags.
    key string
    The Key of Tags.
    value string
    The Value of Tags.
    key str
    The Key of Tags.
    value str
    The Value of Tags.
    key String
    The Key of Tags.
    value String
    The Value of Tags.

    Package Details

    Repository
    volcengine volcengine/pulumi-volcengine
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the volcengine Terraform Provider.
    volcengine logo
    Volcengine v0.0.31 published on Monday, May 12, 2025 by Volcengine