1. Registry
  2. Packages
  3. Selectel Provider
  4. API Docs
  5. VpcSecgroupRuleV2
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

    Creates and manages a rule of a security group using the v2 public API. 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

    Rule that allows inbound SSH traffic from a subnet

    import * as pulumi from "@pulumi/pulumi";
    import * as selectel from "@pulumi/selectel";
    
    const rule1 = new selectel.VpcSecgroupRuleV2("rule_1", {
        projectId: project1.id,
        region: "ru-6",
        securityGroupId: secgroup1.id,
        direction: "ingress",
        ethertype: "IPv4",
        protocol: "tcp",
        portRangeMin: 22,
        portRangeMax: 22,
        remoteIpPrefix: "192.168.199.0/24",
    });
    
    import pulumi
    import pulumi_selectel as selectel
    
    rule1 = selectel.VpcSecgroupRuleV2("rule_1",
        project_id=project1["id"],
        region="ru-6",
        security_group_id=secgroup1["id"],
        direction="ingress",
        ethertype="IPv4",
        protocol="tcp",
        port_range_min=22,
        port_range_max=22,
        remote_ip_prefix="192.168.199.0/24")
    
    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 {
    		_, err := selectel.NewVpcSecgroupRuleV2(ctx, "rule_1", &selectel.VpcSecgroupRuleV2Args{
    			ProjectId:       pulumi.Any(project1.Id),
    			Region:          pulumi.String("ru-6"),
    			SecurityGroupId: pulumi.Any(secgroup1.Id),
    			Direction:       pulumi.String("ingress"),
    			Ethertype:       pulumi.String("IPv4"),
    			Protocol:        pulumi.String("tcp"),
    			PortRangeMin:    pulumi.Float64(22),
    			PortRangeMax:    pulumi.Float64(22),
    			RemoteIpPrefix:  pulumi.String("192.168.199.0/24"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Selectel = Pulumi.Selectel;
    
    return await Deployment.RunAsync(() => 
    {
        var rule1 = new Selectel.VpcSecgroupRuleV2("rule_1", new()
        {
            ProjectId = project1.Id,
            Region = "ru-6",
            SecurityGroupId = secgroup1.Id,
            Direction = "ingress",
            Ethertype = "IPv4",
            Protocol = "tcp",
            PortRangeMin = 22,
            PortRangeMax = 22,
            RemoteIpPrefix = "192.168.199.0/24",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.selectel.VpcSecgroupRuleV2;
    import com.pulumi.selectel.VpcSecgroupRuleV2Args;
    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) {
            var rule1 = new VpcSecgroupRuleV2("rule1", VpcSecgroupRuleV2Args.builder()
                .projectId(project1.id())
                .region("ru-6")
                .securityGroupId(secgroup1.id())
                .direction("ingress")
                .ethertype("IPv4")
                .protocol("tcp")
                .portRangeMin(22.0)
                .portRangeMax(22.0)
                .remoteIpPrefix("192.168.199.0/24")
                .build());
    
        }
    }
    
    resources:
      rule1:
        type: selectel:VpcSecgroupRuleV2
        name: rule_1
        properties:
          projectId: ${project1.id}
          region: ru-6
          securityGroupId: ${secgroup1.id}
          direction: ingress
          ethertype: IPv4
          protocol: tcp
          portRangeMin: 22
          portRangeMax: 22
          remoteIpPrefix: 192.168.199.0/24
    
    Example coming soon!
    

    Rule that allows outbound traffic to another security group

    import * as pulumi from "@pulumi/pulumi";
    import * as selectel from "@pulumi/selectel";
    
    const rule2 = new selectel.VpcSecgroupRuleV2("rule_2", {
        projectId: project1.id,
        region: "ru-6",
        securityGroupId: secgroup1.id,
        direction: "egress",
        ethertype: "IPv4",
        remoteGroupId: secgroup2.id,
    });
    
    import pulumi
    import pulumi_selectel as selectel
    
    rule2 = selectel.VpcSecgroupRuleV2("rule_2",
        project_id=project1["id"],
        region="ru-6",
        security_group_id=secgroup1["id"],
        direction="egress",
        ethertype="IPv4",
        remote_group_id=secgroup2["id"])
    
    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 {
    		_, err := selectel.NewVpcSecgroupRuleV2(ctx, "rule_2", &selectel.VpcSecgroupRuleV2Args{
    			ProjectId:       pulumi.Any(project1.Id),
    			Region:          pulumi.String("ru-6"),
    			SecurityGroupId: pulumi.Any(secgroup1.Id),
    			Direction:       pulumi.String("egress"),
    			Ethertype:       pulumi.String("IPv4"),
    			RemoteGroupId:   pulumi.Any(secgroup2.Id),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Selectel = Pulumi.Selectel;
    
    return await Deployment.RunAsync(() => 
    {
        var rule2 = new Selectel.VpcSecgroupRuleV2("rule_2", new()
        {
            ProjectId = project1.Id,
            Region = "ru-6",
            SecurityGroupId = secgroup1.Id,
            Direction = "egress",
            Ethertype = "IPv4",
            RemoteGroupId = secgroup2.Id,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.selectel.VpcSecgroupRuleV2;
    import com.pulumi.selectel.VpcSecgroupRuleV2Args;
    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) {
            var rule2 = new VpcSecgroupRuleV2("rule2", VpcSecgroupRuleV2Args.builder()
                .projectId(project1.id())
                .region("ru-6")
                .securityGroupId(secgroup1.id())
                .direction("egress")
                .ethertype("IPv4")
                .remoteGroupId(secgroup2.id())
                .build());
    
        }
    }
    
    resources:
      rule2:
        type: selectel:VpcSecgroupRuleV2
        name: rule_2
        properties:
          projectId: ${project1.id}
          region: ru-6
          securityGroupId: ${secgroup1.id}
          direction: egress
          ethertype: IPv4
          remoteGroupId: ${secgroup2.id}
    
    Example coming soon!
    

    Create VpcSecgroupRuleV2 Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new VpcSecgroupRuleV2(name: string, args: VpcSecgroupRuleV2Args, opts?: CustomResourceOptions);
    @overload
    def VpcSecgroupRuleV2(resource_name: str,
                          args: VpcSecgroupRuleV2Args,
                          opts: Optional[ResourceOptions] = None)
    
    @overload
    def VpcSecgroupRuleV2(resource_name: str,
                          opts: Optional[ResourceOptions] = None,
                          direction: Optional[str] = None,
                          ethertype: Optional[str] = None,
                          project_id: Optional[str] = None,
                          region: Optional[str] = None,
                          security_group_id: Optional[str] = None,
                          description: Optional[str] = None,
                          port_range_max: Optional[float] = None,
                          port_range_min: Optional[float] = None,
                          protocol: Optional[str] = None,
                          remote_group_id: Optional[str] = None,
                          remote_ip_prefix: Optional[str] = None)
    func NewVpcSecgroupRuleV2(ctx *Context, name string, args VpcSecgroupRuleV2Args, opts ...ResourceOption) (*VpcSecgroupRuleV2, error)
    public VpcSecgroupRuleV2(string name, VpcSecgroupRuleV2Args args, CustomResourceOptions? opts = null)
    public VpcSecgroupRuleV2(String name, VpcSecgroupRuleV2Args args)
    public VpcSecgroupRuleV2(String name, VpcSecgroupRuleV2Args args, CustomResourceOptions options)
    
    type: selectel:VpcSecgroupRuleV2
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    resource "selectel_vpc_secgroup_rule_v2" "name" {
        # resource properties
    }

    Parameters

    name string
    The unique name of the resource.
    args VpcSecgroupRuleV2Args
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args VpcSecgroupRuleV2Args
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args VpcSecgroupRuleV2Args
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args VpcSecgroupRuleV2Args
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args VpcSecgroupRuleV2Args
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var vpcSecgroupRuleV2Resource = new Selectel.VpcSecgroupRuleV2("vpcSecgroupRuleV2Resource", new()
    {
        Direction = "string",
        Ethertype = "string",
        ProjectId = "string",
        Region = "string",
        SecurityGroupId = "string",
        Description = "string",
        PortRangeMax = 0.0,
        PortRangeMin = 0.0,
        Protocol = "string",
        RemoteGroupId = "string",
        RemoteIpPrefix = "string",
    });
    
    example, err := selectel.NewVpcSecgroupRuleV2(ctx, "vpcSecgroupRuleV2Resource", &selectel.VpcSecgroupRuleV2Args{
    	Direction:       pulumi.String("string"),
    	Ethertype:       pulumi.String("string"),
    	ProjectId:       pulumi.String("string"),
    	Region:          pulumi.String("string"),
    	SecurityGroupId: pulumi.String("string"),
    	Description:     pulumi.String("string"),
    	PortRangeMax:    pulumi.Float64(0),
    	PortRangeMin:    pulumi.Float64(0),
    	Protocol:        pulumi.String("string"),
    	RemoteGroupId:   pulumi.String("string"),
    	RemoteIpPrefix:  pulumi.String("string"),
    })
    
    resource "selectel_vpc_secgroup_rule_v2" "vpcSecgroupRuleV2Resource" {
      lifecycle {
        create_before_destroy = true
      }
      direction         = "string"
      ethertype         = "string"
      project_id        = "string"
      region            = "string"
      security_group_id = "string"
      description       = "string"
      port_range_max    = 0
      port_range_min    = 0
      protocol          = "string"
      remote_group_id   = "string"
      remote_ip_prefix  = "string"
    }
    
    var vpcSecgroupRuleV2Resource = new VpcSecgroupRuleV2("vpcSecgroupRuleV2Resource", VpcSecgroupRuleV2Args.builder()
        .direction("string")
        .ethertype("string")
        .projectId("string")
        .region("string")
        .securityGroupId("string")
        .description("string")
        .portRangeMax(0.0)
        .portRangeMin(0.0)
        .protocol("string")
        .remoteGroupId("string")
        .remoteIpPrefix("string")
        .build());
    
    vpc_secgroup_rule_v2_resource = selectel.VpcSecgroupRuleV2("vpcSecgroupRuleV2Resource",
        direction="string",
        ethertype="string",
        project_id="string",
        region="string",
        security_group_id="string",
        description="string",
        port_range_max=float(0),
        port_range_min=float(0),
        protocol="string",
        remote_group_id="string",
        remote_ip_prefix="string")
    
    const vpcSecgroupRuleV2Resource = new selectel.VpcSecgroupRuleV2("vpcSecgroupRuleV2Resource", {
        direction: "string",
        ethertype: "string",
        projectId: "string",
        region: "string",
        securityGroupId: "string",
        description: "string",
        portRangeMax: 0,
        portRangeMin: 0,
        protocol: "string",
        remoteGroupId: "string",
        remoteIpPrefix: "string",
    });
    
    type: selectel:VpcSecgroupRuleV2
    properties:
        description: string
        direction: string
        ethertype: string
        portRangeMax: 0
        portRangeMin: 0
        projectId: string
        protocol: string
        region: string
        remoteGroupId: string
        remoteIpPrefix: string
        securityGroupId: string
    

    VpcSecgroupRuleV2 Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The VpcSecgroupRuleV2 resource accepts the following input properties:

    Direction string
    Direction of the traffic. Available values are ingress or egress. Changing this creates a new security group rule.
    Ethertype string
    Internet protocol version of the rule. Available values are IPv4 or IPv6. Changing this creates a new security group rule.
    ProjectId string
    Unique identifier of the associated project, for example, a07abc12310546f1b9291ab3013a7d75. Retrieved from the selectelvpcproject_v2 resource. Learn more about Projects. Changing this creates a new security group rule.
    Region string
    Pool where the security group rule is located, for example, ru-6. Learn more about available pools in Product availability by location. Changing this creates a new security group rule.
    SecurityGroupId string
    Unique identifier of the security group the rule belongs to. Retrieved from the selectelvpcsecgroup_v2 resource. Changing this creates a new security group rule.
    Description string
    Description of the rule. Changing this creates a new security group rule.
    PortRangeMax double
    Upper bound of the port range. Available values are from 0 to 65535. With protocol = "icmp", specifies the ICMP code from 0 to 255. Learn more about Security group rules. Requires protocol and port_range_min. Changing this creates a new security group rule.
    PortRangeMin double
    Lower bound of the port range. Available values are from 0 to 65535. With protocol = "icmp", specifies the ICMP type from 0 to 255 and can be set without port_range_max. Learn more about Security group rules. Requires protocol. Changing this creates a new security group rule.
    Protocol string
    Protocol of the rule. As an alternative, you can specify an IP protocol number from 0 to 255 as a string. If not specified, the rule matches any protocol. Learn more about Security group rules. Changing this creates a new security group rule.
    RemoteGroupId string
    Unique identifier of the security group whose members the rule matches. Retrieved from the selectelvpcsecgroup_v2 data source. Conflicts with remote_ip_prefix. Changing this creates a new security group rule.
    RemoteIpPrefix string
    CIDR the rule matches, for example 192.168.1.0/24. Conflicts with remote_group_id. Changing this creates a new security group rule.
    Direction string
    Direction of the traffic. Available values are ingress or egress. Changing this creates a new security group rule.
    Ethertype string
    Internet protocol version of the rule. Available values are IPv4 or IPv6. Changing this creates a new security group rule.
    ProjectId string
    Unique identifier of the associated project, for example, a07abc12310546f1b9291ab3013a7d75. Retrieved from the selectelvpcproject_v2 resource. Learn more about Projects. Changing this creates a new security group rule.
    Region string
    Pool where the security group rule is located, for example, ru-6. Learn more about available pools in Product availability by location. Changing this creates a new security group rule.
    SecurityGroupId string
    Unique identifier of the security group the rule belongs to. Retrieved from the selectelvpcsecgroup_v2 resource. Changing this creates a new security group rule.
    Description string
    Description of the rule. Changing this creates a new security group rule.
    PortRangeMax float64
    Upper bound of the port range. Available values are from 0 to 65535. With protocol = "icmp", specifies the ICMP code from 0 to 255. Learn more about Security group rules. Requires protocol and port_range_min. Changing this creates a new security group rule.
    PortRangeMin float64
    Lower bound of the port range. Available values are from 0 to 65535. With protocol = "icmp", specifies the ICMP type from 0 to 255 and can be set without port_range_max. Learn more about Security group rules. Requires protocol. Changing this creates a new security group rule.
    Protocol string
    Protocol of the rule. As an alternative, you can specify an IP protocol number from 0 to 255 as a string. If not specified, the rule matches any protocol. Learn more about Security group rules. Changing this creates a new security group rule.
    RemoteGroupId string
    Unique identifier of the security group whose members the rule matches. Retrieved from the selectelvpcsecgroup_v2 data source. Conflicts with remote_ip_prefix. Changing this creates a new security group rule.
    RemoteIpPrefix string
    CIDR the rule matches, for example 192.168.1.0/24. Conflicts with remote_group_id. Changing this creates a new security group rule.
    direction string
    Direction of the traffic. Available values are ingress or egress. Changing this creates a new security group rule.
    ethertype string
    Internet protocol version of the rule. Available values are IPv4 or IPv6. Changing this creates a new security group rule.
    project_id string
    Unique identifier of the associated project, for example, a07abc12310546f1b9291ab3013a7d75. Retrieved from the selectelvpcproject_v2 resource. Learn more about Projects. Changing this creates a new security group rule.
    region string
    Pool where the security group rule is located, for example, ru-6. Learn more about available pools in Product availability by location. Changing this creates a new security group rule.
    security_group_id string
    Unique identifier of the security group the rule belongs to. Retrieved from the selectelvpcsecgroup_v2 resource. Changing this creates a new security group rule.
    description string
    Description of the rule. Changing this creates a new security group rule.
    port_range_max number
    Upper bound of the port range. Available values are from 0 to 65535. With protocol = "icmp", specifies the ICMP code from 0 to 255. Learn more about Security group rules. Requires protocol and port_range_min. Changing this creates a new security group rule.
    port_range_min number
    Lower bound of the port range. Available values are from 0 to 65535. With protocol = "icmp", specifies the ICMP type from 0 to 255 and can be set without port_range_max. Learn more about Security group rules. Requires protocol. Changing this creates a new security group rule.
    protocol string
    Protocol of the rule. As an alternative, you can specify an IP protocol number from 0 to 255 as a string. If not specified, the rule matches any protocol. Learn more about Security group rules. Changing this creates a new security group rule.
    remote_group_id string
    Unique identifier of the security group whose members the rule matches. Retrieved from the selectelvpcsecgroup_v2 data source. Conflicts with remote_ip_prefix. Changing this creates a new security group rule.
    remote_ip_prefix string
    CIDR the rule matches, for example 192.168.1.0/24. Conflicts with remote_group_id. Changing this creates a new security group rule.
    direction String
    Direction of the traffic. Available values are ingress or egress. Changing this creates a new security group rule.
    ethertype String
    Internet protocol version of the rule. Available values are IPv4 or IPv6. Changing this creates a new security group rule.
    projectId String
    Unique identifier of the associated project, for example, a07abc12310546f1b9291ab3013a7d75. Retrieved from the selectelvpcproject_v2 resource. Learn more about Projects. Changing this creates a new security group rule.
    region String
    Pool where the security group rule is located, for example, ru-6. Learn more about available pools in Product availability by location. Changing this creates a new security group rule.
    securityGroupId String
    Unique identifier of the security group the rule belongs to. Retrieved from the selectelvpcsecgroup_v2 resource. Changing this creates a new security group rule.
    description String
    Description of the rule. Changing this creates a new security group rule.
    portRangeMax Double
    Upper bound of the port range. Available values are from 0 to 65535. With protocol = "icmp", specifies the ICMP code from 0 to 255. Learn more about Security group rules. Requires protocol and port_range_min. Changing this creates a new security group rule.
    portRangeMin Double
    Lower bound of the port range. Available values are from 0 to 65535. With protocol = "icmp", specifies the ICMP type from 0 to 255 and can be set without port_range_max. Learn more about Security group rules. Requires protocol. Changing this creates a new security group rule.
    protocol String
    Protocol of the rule. As an alternative, you can specify an IP protocol number from 0 to 255 as a string. If not specified, the rule matches any protocol. Learn more about Security group rules. Changing this creates a new security group rule.
    remoteGroupId String
    Unique identifier of the security group whose members the rule matches. Retrieved from the selectelvpcsecgroup_v2 data source. Conflicts with remote_ip_prefix. Changing this creates a new security group rule.
    remoteIpPrefix String
    CIDR the rule matches, for example 192.168.1.0/24. Conflicts with remote_group_id. Changing this creates a new security group rule.
    direction string
    Direction of the traffic. Available values are ingress or egress. Changing this creates a new security group rule.
    ethertype string
    Internet protocol version of the rule. Available values are IPv4 or IPv6. Changing this creates a new security group rule.
    projectId string
    Unique identifier of the associated project, for example, a07abc12310546f1b9291ab3013a7d75. Retrieved from the selectelvpcproject_v2 resource. Learn more about Projects. Changing this creates a new security group rule.
    region string
    Pool where the security group rule is located, for example, ru-6. Learn more about available pools in Product availability by location. Changing this creates a new security group rule.
    securityGroupId string
    Unique identifier of the security group the rule belongs to. Retrieved from the selectelvpcsecgroup_v2 resource. Changing this creates a new security group rule.
    description string
    Description of the rule. Changing this creates a new security group rule.
    portRangeMax number
    Upper bound of the port range. Available values are from 0 to 65535. With protocol = "icmp", specifies the ICMP code from 0 to 255. Learn more about Security group rules. Requires protocol and port_range_min. Changing this creates a new security group rule.
    portRangeMin number
    Lower bound of the port range. Available values are from 0 to 65535. With protocol = "icmp", specifies the ICMP type from 0 to 255 and can be set without port_range_max. Learn more about Security group rules. Requires protocol. Changing this creates a new security group rule.
    protocol string
    Protocol of the rule. As an alternative, you can specify an IP protocol number from 0 to 255 as a string. If not specified, the rule matches any protocol. Learn more about Security group rules. Changing this creates a new security group rule.
    remoteGroupId string
    Unique identifier of the security group whose members the rule matches. Retrieved from the selectelvpcsecgroup_v2 data source. Conflicts with remote_ip_prefix. Changing this creates a new security group rule.
    remoteIpPrefix string
    CIDR the rule matches, for example 192.168.1.0/24. Conflicts with remote_group_id. Changing this creates a new security group rule.
    direction str
    Direction of the traffic. Available values are ingress or egress. Changing this creates a new security group rule.
    ethertype str
    Internet protocol version of the rule. Available values are IPv4 or IPv6. Changing this creates a new security group rule.
    project_id str
    Unique identifier of the associated project, for example, a07abc12310546f1b9291ab3013a7d75. Retrieved from the selectelvpcproject_v2 resource. Learn more about Projects. Changing this creates a new security group rule.
    region str
    Pool where the security group rule is located, for example, ru-6. Learn more about available pools in Product availability by location. Changing this creates a new security group rule.
    security_group_id str
    Unique identifier of the security group the rule belongs to. Retrieved from the selectelvpcsecgroup_v2 resource. Changing this creates a new security group rule.
    description str
    Description of the rule. Changing this creates a new security group rule.
    port_range_max float
    Upper bound of the port range. Available values are from 0 to 65535. With protocol = "icmp", specifies the ICMP code from 0 to 255. Learn more about Security group rules. Requires protocol and port_range_min. Changing this creates a new security group rule.
    port_range_min float
    Lower bound of the port range. Available values are from 0 to 65535. With protocol = "icmp", specifies the ICMP type from 0 to 255 and can be set without port_range_max. Learn more about Security group rules. Requires protocol. Changing this creates a new security group rule.
    protocol str
    Protocol of the rule. As an alternative, you can specify an IP protocol number from 0 to 255 as a string. If not specified, the rule matches any protocol. Learn more about Security group rules. Changing this creates a new security group rule.
    remote_group_id str
    Unique identifier of the security group whose members the rule matches. Retrieved from the selectelvpcsecgroup_v2 data source. Conflicts with remote_ip_prefix. Changing this creates a new security group rule.
    remote_ip_prefix str
    CIDR the rule matches, for example 192.168.1.0/24. Conflicts with remote_group_id. Changing this creates a new security group rule.
    direction String
    Direction of the traffic. Available values are ingress or egress. Changing this creates a new security group rule.
    ethertype String
    Internet protocol version of the rule. Available values are IPv4 or IPv6. Changing this creates a new security group rule.
    projectId String
    Unique identifier of the associated project, for example, a07abc12310546f1b9291ab3013a7d75. Retrieved from the selectelvpcproject_v2 resource. Learn more about Projects. Changing this creates a new security group rule.
    region String
    Pool where the security group rule is located, for example, ru-6. Learn more about available pools in Product availability by location. Changing this creates a new security group rule.
    securityGroupId String
    Unique identifier of the security group the rule belongs to. Retrieved from the selectelvpcsecgroup_v2 resource. Changing this creates a new security group rule.
    description String
    Description of the rule. Changing this creates a new security group rule.
    portRangeMax Number
    Upper bound of the port range. Available values are from 0 to 65535. With protocol = "icmp", specifies the ICMP code from 0 to 255. Learn more about Security group rules. Requires protocol and port_range_min. Changing this creates a new security group rule.
    portRangeMin Number
    Lower bound of the port range. Available values are from 0 to 65535. With protocol = "icmp", specifies the ICMP type from 0 to 255 and can be set without port_range_max. Learn more about Security group rules. Requires protocol. Changing this creates a new security group rule.
    protocol String
    Protocol of the rule. As an alternative, you can specify an IP protocol number from 0 to 255 as a string. If not specified, the rule matches any protocol. Learn more about Security group rules. Changing this creates a new security group rule.
    remoteGroupId String
    Unique identifier of the security group whose members the rule matches. Retrieved from the selectelvpcsecgroup_v2 data source. Conflicts with remote_ip_prefix. Changing this creates a new security group rule.
    remoteIpPrefix String
    CIDR the rule matches, for example 192.168.1.0/24. Conflicts with remote_group_id. Changing this creates a new security group rule.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the VpcSecgroupRuleV2 resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing VpcSecgroupRuleV2 Resource

    Get an existing VpcSecgroupRuleV2 resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: VpcSecgroupRuleV2State, opts?: CustomResourceOptions): VpcSecgroupRuleV2
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            description: Optional[str] = None,
            direction: Optional[str] = None,
            ethertype: Optional[str] = None,
            port_range_max: Optional[float] = None,
            port_range_min: Optional[float] = None,
            project_id: Optional[str] = None,
            protocol: Optional[str] = None,
            region: Optional[str] = None,
            remote_group_id: Optional[str] = None,
            remote_ip_prefix: Optional[str] = None,
            security_group_id: Optional[str] = None) -> VpcSecgroupRuleV2
    func GetVpcSecgroupRuleV2(ctx *Context, name string, id IDInput, state *VpcSecgroupRuleV2State, opts ...ResourceOption) (*VpcSecgroupRuleV2, error)
    public static VpcSecgroupRuleV2 Get(string name, Input<string> id, VpcSecgroupRuleV2State? state, CustomResourceOptions? opts = null)
    public static VpcSecgroupRuleV2 get(String name, Output<String> id, VpcSecgroupRuleV2State state, CustomResourceOptions options)
    resources:  _:    type: selectel:VpcSecgroupRuleV2    get:      id: ${id}
    import {
      to = selectel_vpc_secgroup_rule_v2.example
      id = "${id}"
    }
    
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    Description string
    Description of the rule. Changing this creates a new security group rule.
    Direction string
    Direction of the traffic. Available values are ingress or egress. Changing this creates a new security group rule.
    Ethertype string
    Internet protocol version of the rule. Available values are IPv4 or IPv6. Changing this creates a new security group rule.
    PortRangeMax double
    Upper bound of the port range. Available values are from 0 to 65535. With protocol = "icmp", specifies the ICMP code from 0 to 255. Learn more about Security group rules. Requires protocol and port_range_min. Changing this creates a new security group rule.
    PortRangeMin double
    Lower bound of the port range. Available values are from 0 to 65535. With protocol = "icmp", specifies the ICMP type from 0 to 255 and can be set without port_range_max. Learn more about Security group rules. Requires protocol. Changing this creates a new security group rule.
    ProjectId string
    Unique identifier of the associated project, for example, a07abc12310546f1b9291ab3013a7d75. Retrieved from the selectelvpcproject_v2 resource. Learn more about Projects. Changing this creates a new security group rule.
    Protocol string
    Protocol of the rule. As an alternative, you can specify an IP protocol number from 0 to 255 as a string. If not specified, the rule matches any protocol. Learn more about Security group rules. Changing this creates a new security group rule.
    Region string
    Pool where the security group rule is located, for example, ru-6. Learn more about available pools in Product availability by location. Changing this creates a new security group rule.
    RemoteGroupId string
    Unique identifier of the security group whose members the rule matches. Retrieved from the selectelvpcsecgroup_v2 data source. Conflicts with remote_ip_prefix. Changing this creates a new security group rule.
    RemoteIpPrefix string
    CIDR the rule matches, for example 192.168.1.0/24. Conflicts with remote_group_id. Changing this creates a new security group rule.
    SecurityGroupId string
    Unique identifier of the security group the rule belongs to. Retrieved from the selectelvpcsecgroup_v2 resource. Changing this creates a new security group rule.
    Description string
    Description of the rule. Changing this creates a new security group rule.
    Direction string
    Direction of the traffic. Available values are ingress or egress. Changing this creates a new security group rule.
    Ethertype string
    Internet protocol version of the rule. Available values are IPv4 or IPv6. Changing this creates a new security group rule.
    PortRangeMax float64
    Upper bound of the port range. Available values are from 0 to 65535. With protocol = "icmp", specifies the ICMP code from 0 to 255. Learn more about Security group rules. Requires protocol and port_range_min. Changing this creates a new security group rule.
    PortRangeMin float64
    Lower bound of the port range. Available values are from 0 to 65535. With protocol = "icmp", specifies the ICMP type from 0 to 255 and can be set without port_range_max. Learn more about Security group rules. Requires protocol. Changing this creates a new security group rule.
    ProjectId string
    Unique identifier of the associated project, for example, a07abc12310546f1b9291ab3013a7d75. Retrieved from the selectelvpcproject_v2 resource. Learn more about Projects. Changing this creates a new security group rule.
    Protocol string
    Protocol of the rule. As an alternative, you can specify an IP protocol number from 0 to 255 as a string. If not specified, the rule matches any protocol. Learn more about Security group rules. Changing this creates a new security group rule.
    Region string
    Pool where the security group rule is located, for example, ru-6. Learn more about available pools in Product availability by location. Changing this creates a new security group rule.
    RemoteGroupId string
    Unique identifier of the security group whose members the rule matches. Retrieved from the selectelvpcsecgroup_v2 data source. Conflicts with remote_ip_prefix. Changing this creates a new security group rule.
    RemoteIpPrefix string
    CIDR the rule matches, for example 192.168.1.0/24. Conflicts with remote_group_id. Changing this creates a new security group rule.
    SecurityGroupId string
    Unique identifier of the security group the rule belongs to. Retrieved from the selectelvpcsecgroup_v2 resource. Changing this creates a new security group rule.
    description string
    Description of the rule. Changing this creates a new security group rule.
    direction string
    Direction of the traffic. Available values are ingress or egress. Changing this creates a new security group rule.
    ethertype string
    Internet protocol version of the rule. Available values are IPv4 or IPv6. Changing this creates a new security group rule.
    port_range_max number
    Upper bound of the port range. Available values are from 0 to 65535. With protocol = "icmp", specifies the ICMP code from 0 to 255. Learn more about Security group rules. Requires protocol and port_range_min. Changing this creates a new security group rule.
    port_range_min number
    Lower bound of the port range. Available values are from 0 to 65535. With protocol = "icmp", specifies the ICMP type from 0 to 255 and can be set without port_range_max. Learn more about Security group rules. Requires protocol. Changing this creates a new security group rule.
    project_id string
    Unique identifier of the associated project, for example, a07abc12310546f1b9291ab3013a7d75. Retrieved from the selectelvpcproject_v2 resource. Learn more about Projects. Changing this creates a new security group rule.
    protocol string
    Protocol of the rule. As an alternative, you can specify an IP protocol number from 0 to 255 as a string. If not specified, the rule matches any protocol. Learn more about Security group rules. Changing this creates a new security group rule.
    region string
    Pool where the security group rule is located, for example, ru-6. Learn more about available pools in Product availability by location. Changing this creates a new security group rule.
    remote_group_id string
    Unique identifier of the security group whose members the rule matches. Retrieved from the selectelvpcsecgroup_v2 data source. Conflicts with remote_ip_prefix. Changing this creates a new security group rule.
    remote_ip_prefix string
    CIDR the rule matches, for example 192.168.1.0/24. Conflicts with remote_group_id. Changing this creates a new security group rule.
    security_group_id string
    Unique identifier of the security group the rule belongs to. Retrieved from the selectelvpcsecgroup_v2 resource. Changing this creates a new security group rule.
    description String
    Description of the rule. Changing this creates a new security group rule.
    direction String
    Direction of the traffic. Available values are ingress or egress. Changing this creates a new security group rule.
    ethertype String
    Internet protocol version of the rule. Available values are IPv4 or IPv6. Changing this creates a new security group rule.
    portRangeMax Double
    Upper bound of the port range. Available values are from 0 to 65535. With protocol = "icmp", specifies the ICMP code from 0 to 255. Learn more about Security group rules. Requires protocol and port_range_min. Changing this creates a new security group rule.
    portRangeMin Double
    Lower bound of the port range. Available values are from 0 to 65535. With protocol = "icmp", specifies the ICMP type from 0 to 255 and can be set without port_range_max. Learn more about Security group rules. Requires protocol. Changing this creates a new security group rule.
    projectId String
    Unique identifier of the associated project, for example, a07abc12310546f1b9291ab3013a7d75. Retrieved from the selectelvpcproject_v2 resource. Learn more about Projects. Changing this creates a new security group rule.
    protocol String
    Protocol of the rule. As an alternative, you can specify an IP protocol number from 0 to 255 as a string. If not specified, the rule matches any protocol. Learn more about Security group rules. Changing this creates a new security group rule.
    region String
    Pool where the security group rule is located, for example, ru-6. Learn more about available pools in Product availability by location. Changing this creates a new security group rule.
    remoteGroupId String
    Unique identifier of the security group whose members the rule matches. Retrieved from the selectelvpcsecgroup_v2 data source. Conflicts with remote_ip_prefix. Changing this creates a new security group rule.
    remoteIpPrefix String
    CIDR the rule matches, for example 192.168.1.0/24. Conflicts with remote_group_id. Changing this creates a new security group rule.
    securityGroupId String
    Unique identifier of the security group the rule belongs to. Retrieved from the selectelvpcsecgroup_v2 resource. Changing this creates a new security group rule.
    description string
    Description of the rule. Changing this creates a new security group rule.
    direction string
    Direction of the traffic. Available values are ingress or egress. Changing this creates a new security group rule.
    ethertype string
    Internet protocol version of the rule. Available values are IPv4 or IPv6. Changing this creates a new security group rule.
    portRangeMax number
    Upper bound of the port range. Available values are from 0 to 65535. With protocol = "icmp", specifies the ICMP code from 0 to 255. Learn more about Security group rules. Requires protocol and port_range_min. Changing this creates a new security group rule.
    portRangeMin number
    Lower bound of the port range. Available values are from 0 to 65535. With protocol = "icmp", specifies the ICMP type from 0 to 255 and can be set without port_range_max. Learn more about Security group rules. Requires protocol. Changing this creates a new security group rule.
    projectId string
    Unique identifier of the associated project, for example, a07abc12310546f1b9291ab3013a7d75. Retrieved from the selectelvpcproject_v2 resource. Learn more about Projects. Changing this creates a new security group rule.
    protocol string
    Protocol of the rule. As an alternative, you can specify an IP protocol number from 0 to 255 as a string. If not specified, the rule matches any protocol. Learn more about Security group rules. Changing this creates a new security group rule.
    region string
    Pool where the security group rule is located, for example, ru-6. Learn more about available pools in Product availability by location. Changing this creates a new security group rule.
    remoteGroupId string
    Unique identifier of the security group whose members the rule matches. Retrieved from the selectelvpcsecgroup_v2 data source. Conflicts with remote_ip_prefix. Changing this creates a new security group rule.
    remoteIpPrefix string
    CIDR the rule matches, for example 192.168.1.0/24. Conflicts with remote_group_id. Changing this creates a new security group rule.
    securityGroupId string
    Unique identifier of the security group the rule belongs to. Retrieved from the selectelvpcsecgroup_v2 resource. Changing this creates a new security group rule.
    description str
    Description of the rule. Changing this creates a new security group rule.
    direction str
    Direction of the traffic. Available values are ingress or egress. Changing this creates a new security group rule.
    ethertype str
    Internet protocol version of the rule. Available values are IPv4 or IPv6. Changing this creates a new security group rule.
    port_range_max float
    Upper bound of the port range. Available values are from 0 to 65535. With protocol = "icmp", specifies the ICMP code from 0 to 255. Learn more about Security group rules. Requires protocol and port_range_min. Changing this creates a new security group rule.
    port_range_min float
    Lower bound of the port range. Available values are from 0 to 65535. With protocol = "icmp", specifies the ICMP type from 0 to 255 and can be set without port_range_max. Learn more about Security group rules. Requires protocol. Changing this creates a new security group rule.
    project_id str
    Unique identifier of the associated project, for example, a07abc12310546f1b9291ab3013a7d75. Retrieved from the selectelvpcproject_v2 resource. Learn more about Projects. Changing this creates a new security group rule.
    protocol str
    Protocol of the rule. As an alternative, you can specify an IP protocol number from 0 to 255 as a string. If not specified, the rule matches any protocol. Learn more about Security group rules. Changing this creates a new security group rule.
    region str
    Pool where the security group rule is located, for example, ru-6. Learn more about available pools in Product availability by location. Changing this creates a new security group rule.
    remote_group_id str
    Unique identifier of the security group whose members the rule matches. Retrieved from the selectelvpcsecgroup_v2 data source. Conflicts with remote_ip_prefix. Changing this creates a new security group rule.
    remote_ip_prefix str
    CIDR the rule matches, for example 192.168.1.0/24. Conflicts with remote_group_id. Changing this creates a new security group rule.
    security_group_id str
    Unique identifier of the security group the rule belongs to. Retrieved from the selectelvpcsecgroup_v2 resource. Changing this creates a new security group rule.
    description String
    Description of the rule. Changing this creates a new security group rule.
    direction String
    Direction of the traffic. Available values are ingress or egress. Changing this creates a new security group rule.
    ethertype String
    Internet protocol version of the rule. Available values are IPv4 or IPv6. Changing this creates a new security group rule.
    portRangeMax Number
    Upper bound of the port range. Available values are from 0 to 65535. With protocol = "icmp", specifies the ICMP code from 0 to 255. Learn more about Security group rules. Requires protocol and port_range_min. Changing this creates a new security group rule.
    portRangeMin Number
    Lower bound of the port range. Available values are from 0 to 65535. With protocol = "icmp", specifies the ICMP type from 0 to 255 and can be set without port_range_max. Learn more about Security group rules. Requires protocol. Changing this creates a new security group rule.
    projectId String
    Unique identifier of the associated project, for example, a07abc12310546f1b9291ab3013a7d75. Retrieved from the selectelvpcproject_v2 resource. Learn more about Projects. Changing this creates a new security group rule.
    protocol String
    Protocol of the rule. As an alternative, you can specify an IP protocol number from 0 to 255 as a string. If not specified, the rule matches any protocol. Learn more about Security group rules. Changing this creates a new security group rule.
    region String
    Pool where the security group rule is located, for example, ru-6. Learn more about available pools in Product availability by location. Changing this creates a new security group rule.
    remoteGroupId String
    Unique identifier of the security group whose members the rule matches. Retrieved from the selectelvpcsecgroup_v2 data source. Conflicts with remote_ip_prefix. Changing this creates a new security group rule.
    remoteIpPrefix String
    CIDR the rule matches, for example 192.168.1.0/24. Conflicts with remote_group_id. Changing this creates a new security group rule.
    securityGroupId String
    Unique identifier of the security group the rule belongs to. Retrieved from the selectelvpcsecgroup_v2 resource. Changing this creates a new security group rule.

    Import

    All versions

    Use the pulumi import command:

    export OS_DOMAIN_NAME=<domain_name>

    export OS_USERNAME=

    export OS_PASSWORD=

    export INFRA_PROJECT_ID=<project_id>

    export INFRA_REGION=

    $ pulumi import selectel:index/vpcSecgroupRuleV2:VpcSecgroupRuleV2 rule_1 <id>
    

    <domain_name>, <username>, and <password> are the arguments of the provider configuration.

    Other identity attributes are described above in the import or resource sections.

    To learn more about importing existing cloud resources, see Importing resources.

    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