1. Registry
  2. Packages
  3. Selectel Provider
  4. API Docs
  5. getVpcSecgroupV2
Viewing docs for selectel 9.5.0
published on Friday, Oct 30, 2026 by selectel
selectel
Viewing docs for selectel 9.5.0
published on Friday, Oct 30, 2026 by selectel

    Provides a security group. For more information about security groups, see the official Selectel documentation.

    If you are upgrading from a version earlier than 9.1.0, follow the upgrade guide to migrate your resources from the OpenStack provider.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as selectel from "@pulumi/selectel";
    
    // Security group found by name
    const secgroup1 = selectel.getVpcSecgroupV2({
        projectId: project1.id,
        region: "ru-6",
        name: "secgroup-1",
    });
    
    import pulumi
    import pulumi_selectel as selectel
    
    # Security group found by name
    secgroup1 = selectel.get_vpc_secgroup_v2(project_id=project1["id"],
        region="ru-6",
        name="secgroup-1")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/selectel/v9/selectel"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		// Security group found by name
    		_, err := selectel.LookupVpcSecgroupV2(ctx, &selectel.LookupVpcSecgroupV2Args{
    			ProjectId: project1.Id,
    			Region:    "ru-6",
    			Name:      pulumi.StringRef("secgroup-1"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Selectel = Pulumi.Selectel;
    
    return await Deployment.RunAsync(() => 
    {
        // Security group found by name
        var secgroup1 = Selectel.GetVpcSecgroupV2.Invoke(new()
        {
            ProjectId = project1.Id,
            Region = "ru-6",
            Name = "secgroup-1",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.selectel.SelectelFunctions;
    import com.pulumi.selectel.inputs.GetVpcSecgroupV2Args;
    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) {
            // Security group found by name
            final var secgroup1 = SelectelFunctions.getVpcSecgroupV2(GetVpcSecgroupV2Args.builder()
                .projectId(project1.id())
                .region("ru-6")
                .name("secgroup-1")
                .build());
    
        }
    }
    
    variables:
      # Security group found by name
      secgroup1:
        fn::invoke:
          function: selectel:getVpcSecgroupV2
          arguments:
            projectId: ${project1.id}
            region: ru-6
            name: secgroup-1
    
    Example coming soon!
    
    import * as pulumi from "@pulumi/pulumi";
    import * as selectel from "@pulumi/selectel";
    
    // Default security group of the project
    const secgroup2 = selectel.getVpcSecgroupV2({
        projectId: project1.id,
        region: "ru-6",
        name: "default",
    });
    
    import pulumi
    import pulumi_selectel as selectel
    
    # Default security group of the project
    secgroup2 = selectel.get_vpc_secgroup_v2(project_id=project1["id"],
        region="ru-6",
        name="default")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/selectel/v9/selectel"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		// Default security group of the project
    		_, err := selectel.LookupVpcSecgroupV2(ctx, &selectel.LookupVpcSecgroupV2Args{
    			ProjectId: project1.Id,
    			Region:    "ru-6",
    			Name:      pulumi.StringRef("default"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Selectel = Pulumi.Selectel;
    
    return await Deployment.RunAsync(() => 
    {
        // Default security group of the project
        var secgroup2 = Selectel.GetVpcSecgroupV2.Invoke(new()
        {
            ProjectId = project1.Id,
            Region = "ru-6",
            Name = "default",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.selectel.SelectelFunctions;
    import com.pulumi.selectel.inputs.GetVpcSecgroupV2Args;
    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) {
            // Default security group of the project
            final var secgroup2 = SelectelFunctions.getVpcSecgroupV2(GetVpcSecgroupV2Args.builder()
                .projectId(project1.id())
                .region("ru-6")
                .name("default")
                .build());
    
        }
    }
    
    variables:
      # Default security group of the project
      secgroup2:
        fn::invoke:
          function: selectel:getVpcSecgroupV2
          arguments:
            projectId: ${project1.id}
            region: ru-6
            name: default
    
    Example coming soon!
    

    Using getVpcSecgroupV2

    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 getVpcSecgroupV2(args: GetVpcSecgroupV2Args, opts?: InvokeOptions): Promise<GetVpcSecgroupV2Result>
    function getVpcSecgroupV2Output(args: GetVpcSecgroupV2OutputArgs, opts?: InvokeOutputOptions): Output<GetVpcSecgroupV2Result>
    def get_vpc_secgroup_v2(description: Optional[str] = None,
                            name: Optional[str] = None,
                            project_id: Optional[str] = None,
                            region: Optional[str] = None,
                            secgroup_id: Optional[str] = None,
                            tags: Optional[Sequence[str]] = None,
                            opts: Optional[InvokeOptions] = None) -> GetVpcSecgroupV2Result
    def get_vpc_secgroup_v2_output(description: pulumi.Input[Optional[str]] = None,
                            name: pulumi.Input[Optional[str]] = None,
                            project_id: pulumi.Input[Optional[str]] = None,
                            region: pulumi.Input[Optional[str]] = None,
                            secgroup_id: pulumi.Input[Optional[str]] = None,
                            tags: pulumi.Input[Optional[Sequence[pulumi.Input[str]]]] = None,
                            opts: Optional[InvokeOutputOptions] = None) -> Output[GetVpcSecgroupV2Result]
    func LookupVpcSecgroupV2(ctx *Context, args *LookupVpcSecgroupV2Args, opts ...InvokeOption) (*LookupVpcSecgroupV2Result, error)
    func LookupVpcSecgroupV2Output(ctx *Context, args *LookupVpcSecgroupV2OutputArgs, opts ...InvokeOption) LookupVpcSecgroupV2ResultOutput

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

    public static class GetVpcSecgroupV2 
    {
        public static Task<GetVpcSecgroupV2Result> InvokeAsync(GetVpcSecgroupV2Args args, InvokeOptions? opts = null)
        public static Output<GetVpcSecgroupV2Result> Invoke(GetVpcSecgroupV2InvokeArgs args, InvokeOptions? opts = null)
        public static Output<GetVpcSecgroupV2Result> Invoke(GetVpcSecgroupV2InvokeArgs args, InvokeOutputOptions opts)
    }
    public static CompletableFuture<GetVpcSecgroupV2Result> getVpcSecgroupV2(GetVpcSecgroupV2Args args, InvokeOptions options)
    public static Output<GetVpcSecgroupV2Result> getVpcSecgroupV2(GetVpcSecgroupV2Args args, InvokeOptions options)
    public static Output<GetVpcSecgroupV2Result> getVpcSecgroupV2(GetVpcSecgroupV2Args args, InvokeOutputOptions options)
    
    fn::invoke:
      function: selectel:index/getVpcSecgroupV2:getVpcSecgroupV2
      arguments:
        # arguments dictionary
    data "selectel_get_vpc_secgroup_v2" "name" {
        # arguments
    }

    The following arguments are supported:

    ProjectId string
    Unique identifier of the associated project, for example, a07abc12310546f1b9291ab3013a7d75. Retrieved from the selectelvpcproject_v2 resource. Learn more about Projects.
    Region string
    Pool where the security group is located, for example, ru-6. Learn more about available pools in Product availability by location.
    Description string
    Description of the security group.
    Name string
    Name of the security group.
    SecgroupId string
    Unique identifier of the security group. To get the security group ID, in the Control panel, go to Products ⟶ Cloud Servers ⟶ Security groups ⟶ copy the ID in the card of the required security group.
    Tags List<string>
    Tags of the security group.
    ProjectId string
    Unique identifier of the associated project, for example, a07abc12310546f1b9291ab3013a7d75. Retrieved from the selectelvpcproject_v2 resource. Learn more about Projects.
    Region string
    Pool where the security group is located, for example, ru-6. Learn more about available pools in Product availability by location.
    Description string
    Description of the security group.
    Name string
    Name of the security group.
    SecgroupId string
    Unique identifier of the security group. To get the security group ID, in the Control panel, go to Products ⟶ Cloud Servers ⟶ Security groups ⟶ copy the ID in the card of the required security group.
    Tags []string
    Tags of the security group.
    project_id string
    Unique identifier of the associated project, for example, a07abc12310546f1b9291ab3013a7d75. Retrieved from the selectelvpcproject_v2 resource. Learn more about Projects.
    region string
    Pool where the security group is located, for example, ru-6. Learn more about available pools in Product availability by location.
    description string
    Description of the security group.
    name string
    Name of the security group.
    secgroup_id string
    Unique identifier of the security group. To get the security group ID, in the Control panel, go to Products ⟶ Cloud Servers ⟶ Security groups ⟶ copy the ID in the card of the required security group.
    tags list(string)
    Tags of the security group.
    projectId String
    Unique identifier of the associated project, for example, a07abc12310546f1b9291ab3013a7d75. Retrieved from the selectelvpcproject_v2 resource. Learn more about Projects.
    region String
    Pool where the security group is located, for example, ru-6. Learn more about available pools in Product availability by location.
    description String
    Description of the security group.
    name String
    Name of the security group.
    secgroupId String
    Unique identifier of the security group. To get the security group ID, in the Control panel, go to Products ⟶ Cloud Servers ⟶ Security groups ⟶ copy the ID in the card of the required security group.
    tags List<String>
    Tags of the security group.
    projectId string
    Unique identifier of the associated project, for example, a07abc12310546f1b9291ab3013a7d75. Retrieved from the selectelvpcproject_v2 resource. Learn more about Projects.
    region string
    Pool where the security group is located, for example, ru-6. Learn more about available pools in Product availability by location.
    description string
    Description of the security group.
    name string
    Name of the security group.
    secgroupId string
    Unique identifier of the security group. To get the security group ID, in the Control panel, go to Products ⟶ Cloud Servers ⟶ Security groups ⟶ copy the ID in the card of the required security group.
    tags string[]
    Tags of the security group.
    project_id str
    Unique identifier of the associated project, for example, a07abc12310546f1b9291ab3013a7d75. Retrieved from the selectelvpcproject_v2 resource. Learn more about Projects.
    region str
    Pool where the security group is located, for example, ru-6. Learn more about available pools in Product availability by location.
    description str
    Description of the security group.
    name str
    Name of the security group.
    secgroup_id str
    Unique identifier of the security group. To get the security group ID, in the Control panel, go to Products ⟶ Cloud Servers ⟶ Security groups ⟶ copy the ID in the card of the required security group.
    tags Sequence[str]
    Tags of the security group.
    projectId String
    Unique identifier of the associated project, for example, a07abc12310546f1b9291ab3013a7d75. Retrieved from the selectelvpcproject_v2 resource. Learn more about Projects.
    region String
    Pool where the security group is located, for example, ru-6. Learn more about available pools in Product availability by location.
    description String
    Description of the security group.
    name String
    Name of the security group.
    secgroupId String
    Unique identifier of the security group. To get the security group ID, in the Control panel, go to Products ⟶ Cloud Servers ⟶ Security groups ⟶ copy the ID in the card of the required security group.
    tags List<String>
    Tags of the security group.

    getVpcSecgroupV2 Result

    The following output properties are available:

    AllTags List<string>
    All tags of the security group.
    Description string
    Description of the security group.
    Id string
    Unique identifier of the security group.
    Name string
    Name of the security group.
    ProjectId string
    Unique identifier of the associated project, for example, a07abc12310546f1b9291ab3013a7d75. Retrieved from the selectelvpcproject_v2 resource. Learn more about Projects.
    Region string
    Pool where the security group is located, for example, ru-6. Learn more about available pools in Product availability by location.
    SecgroupId string
    Unique identifier of the security group. To get the security group ID, in the Control panel, go to Products ⟶ Cloud Servers ⟶ Security groups ⟶ copy the ID in the card of the required security group.
    SecurityGroupRules List<string>
    Unique identifiers of rules contained in the security group.
    Shared bool
    Specifies if another project has been granted access to this group.
    Stateful bool
    Specifies if the security group is stateful.
    Tags List<string>
    Tags of the security group.
    AllTags []string
    All tags of the security group.
    Description string
    Description of the security group.
    Id string
    Unique identifier of the security group.
    Name string
    Name of the security group.
    ProjectId string
    Unique identifier of the associated project, for example, a07abc12310546f1b9291ab3013a7d75. Retrieved from the selectelvpcproject_v2 resource. Learn more about Projects.
    Region string
    Pool where the security group is located, for example, ru-6. Learn more about available pools in Product availability by location.
    SecgroupId string
    Unique identifier of the security group. To get the security group ID, in the Control panel, go to Products ⟶ Cloud Servers ⟶ Security groups ⟶ copy the ID in the card of the required security group.
    SecurityGroupRules []string
    Unique identifiers of rules contained in the security group.
    Shared bool
    Specifies if another project has been granted access to this group.
    Stateful bool
    Specifies if the security group is stateful.
    Tags []string
    Tags of the security group.
    all_tags list(string)
    All tags of the security group.
    description string
    Description of the security group.
    id string
    Unique identifier of the security group.
    name string
    Name of the security group.
    project_id string
    Unique identifier of the associated project, for example, a07abc12310546f1b9291ab3013a7d75. Retrieved from the selectelvpcproject_v2 resource. Learn more about Projects.
    region string
    Pool where the security group is located, for example, ru-6. Learn more about available pools in Product availability by location.
    secgroup_id string
    Unique identifier of the security group. To get the security group ID, in the Control panel, go to Products ⟶ Cloud Servers ⟶ Security groups ⟶ copy the ID in the card of the required security group.
    security_group_rules list(string)
    Unique identifiers of rules contained in the security group.
    shared bool
    Specifies if another project has been granted access to this group.
    stateful bool
    Specifies if the security group is stateful.
    tags list(string)
    Tags of the security group.
    allTags List<String>
    All tags of the security group.
    description String
    Description of the security group.
    id String
    Unique identifier of the security group.
    name String
    Name of the security group.
    projectId String
    Unique identifier of the associated project, for example, a07abc12310546f1b9291ab3013a7d75. Retrieved from the selectelvpcproject_v2 resource. Learn more about Projects.
    region String
    Pool where the security group is located, for example, ru-6. Learn more about available pools in Product availability by location.
    secgroupId String
    Unique identifier of the security group. To get the security group ID, in the Control panel, go to Products ⟶ Cloud Servers ⟶ Security groups ⟶ copy the ID in the card of the required security group.
    securityGroupRules List<String>
    Unique identifiers of rules contained in the security group.
    shared Boolean
    Specifies if another project has been granted access to this group.
    stateful Boolean
    Specifies if the security group is stateful.
    tags List<String>
    Tags of the security group.
    allTags string[]
    All tags of the security group.
    description string
    Description of the security group.
    id string
    Unique identifier of the security group.
    name string
    Name of the security group.
    projectId string
    Unique identifier of the associated project, for example, a07abc12310546f1b9291ab3013a7d75. Retrieved from the selectelvpcproject_v2 resource. Learn more about Projects.
    region string
    Pool where the security group is located, for example, ru-6. Learn more about available pools in Product availability by location.
    secgroupId string
    Unique identifier of the security group. To get the security group ID, in the Control panel, go to Products ⟶ Cloud Servers ⟶ Security groups ⟶ copy the ID in the card of the required security group.
    securityGroupRules string[]
    Unique identifiers of rules contained in the security group.
    shared boolean
    Specifies if another project has been granted access to this group.
    stateful boolean
    Specifies if the security group is stateful.
    tags string[]
    Tags of the security group.
    all_tags Sequence[str]
    All tags of the security group.
    description str
    Description of the security group.
    id str
    Unique identifier of the security group.
    name str
    Name of the security group.
    project_id str
    Unique identifier of the associated project, for example, a07abc12310546f1b9291ab3013a7d75. Retrieved from the selectelvpcproject_v2 resource. Learn more about Projects.
    region str
    Pool where the security group is located, for example, ru-6. Learn more about available pools in Product availability by location.
    secgroup_id str
    Unique identifier of the security group. To get the security group ID, in the Control panel, go to Products ⟶ Cloud Servers ⟶ Security groups ⟶ copy the ID in the card of the required security group.
    security_group_rules Sequence[str]
    Unique identifiers of rules contained in the security group.
    shared bool
    Specifies if another project has been granted access to this group.
    stateful bool
    Specifies if the security group is stateful.
    tags Sequence[str]
    Tags of the security group.
    allTags List<String>
    All tags of the security group.
    description String
    Description of the security group.
    id String
    Unique identifier of the security group.
    name String
    Name of the security group.
    projectId String
    Unique identifier of the associated project, for example, a07abc12310546f1b9291ab3013a7d75. Retrieved from the selectelvpcproject_v2 resource. Learn more about Projects.
    region String
    Pool where the security group is located, for example, ru-6. Learn more about available pools in Product availability by location.
    secgroupId String
    Unique identifier of the security group. To get the security group ID, in the Control panel, go to Products ⟶ Cloud Servers ⟶ Security groups ⟶ copy the ID in the card of the required security group.
    securityGroupRules List<String>
    Unique identifiers of rules contained in the security group.
    shared Boolean
    Specifies if another project has been granted access to this group.
    stateful Boolean
    Specifies if the security group is stateful.
    tags List<String>
    Tags of the security group.

    Package Details

    Repository
    selectel selectel/terraform-provider-selectel
    License
    Notes
    This Pulumi package is based on the selectel Terraform Provider.
    selectel
    Viewing docs for selectel 9.5.0
    published on Friday, Oct 30, 2026 by selectel

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial