published on Friday, Oct 30, 2026 by selectel
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
ingressoregress. Changing this creates a new security group rule. - Ethertype string
- Internet protocol version of the rule. Available values are
IPv4orIPv6. 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 stringId - 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 doubleMax - Upper bound of the port range. Available values are from
0to65535. Withprotocol = "icmp", specifies the ICMP code from0to255. Learn more about Security group rules. Requiresprotocolandport_range_min. Changing this creates a new security group rule. - Port
Range doubleMin - Lower bound of the port range. Available values are from
0to65535. Withprotocol = "icmp", specifies the ICMP type from0to255and can be set withoutport_range_max. Learn more about Security group rules. Requiresprotocol. 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
0to255as 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 stringId - 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 stringPrefix - CIDR the rule matches, for example
192.168.1.0/24. Conflicts withremote_group_id. Changing this creates a new security group rule.
- Direction string
- Direction of the traffic. Available values are
ingressoregress. Changing this creates a new security group rule. - Ethertype string
- Internet protocol version of the rule. Available values are
IPv4orIPv6. 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 stringId - 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 float64Max - Upper bound of the port range. Available values are from
0to65535. Withprotocol = "icmp", specifies the ICMP code from0to255. Learn more about Security group rules. Requiresprotocolandport_range_min. Changing this creates a new security group rule. - Port
Range float64Min - Lower bound of the port range. Available values are from
0to65535. Withprotocol = "icmp", specifies the ICMP type from0to255and can be set withoutport_range_max. Learn more about Security group rules. Requiresprotocol. 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
0to255as 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 stringId - 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 stringPrefix - CIDR the rule matches, for example
192.168.1.0/24. Conflicts withremote_group_id. Changing this creates a new security group rule.
- direction string
- Direction of the traffic. Available values are
ingressoregress. Changing this creates a new security group rule. - ethertype string
- Internet protocol version of the rule. Available values are
IPv4orIPv6. 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_ stringid - 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_ numbermax - Upper bound of the port range. Available values are from
0to65535. Withprotocol = "icmp", specifies the ICMP code from0to255. Learn more about Security group rules. Requiresprotocolandport_range_min. Changing this creates a new security group rule. - port_
range_ numbermin - Lower bound of the port range. Available values are from
0to65535. Withprotocol = "icmp", specifies the ICMP type from0to255and can be set withoutport_range_max. Learn more about Security group rules. Requiresprotocol. 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
0to255as 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_ stringid - 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_ stringprefix - CIDR the rule matches, for example
192.168.1.0/24. Conflicts withremote_group_id. Changing this creates a new security group rule.
- direction String
- Direction of the traffic. Available values are
ingressoregress. Changing this creates a new security group rule. - ethertype String
- Internet protocol version of the rule. Available values are
IPv4orIPv6. 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 StringId - 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 DoubleMax - Upper bound of the port range. Available values are from
0to65535. Withprotocol = "icmp", specifies the ICMP code from0to255. Learn more about Security group rules. Requiresprotocolandport_range_min. Changing this creates a new security group rule. - port
Range DoubleMin - Lower bound of the port range. Available values are from
0to65535. Withprotocol = "icmp", specifies the ICMP type from0to255and can be set withoutport_range_max. Learn more about Security group rules. Requiresprotocol. 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
0to255as 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 StringId - 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 StringPrefix - CIDR the rule matches, for example
192.168.1.0/24. Conflicts withremote_group_id. Changing this creates a new security group rule.
- direction string
- Direction of the traffic. Available values are
ingressoregress. Changing this creates a new security group rule. - ethertype string
- Internet protocol version of the rule. Available values are
IPv4orIPv6. 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 stringId - 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 numberMax - Upper bound of the port range. Available values are from
0to65535. Withprotocol = "icmp", specifies the ICMP code from0to255. Learn more about Security group rules. Requiresprotocolandport_range_min. Changing this creates a new security group rule. - port
Range numberMin - Lower bound of the port range. Available values are from
0to65535. Withprotocol = "icmp", specifies the ICMP type from0to255and can be set withoutport_range_max. Learn more about Security group rules. Requiresprotocol. 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
0to255as 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 stringId - 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 stringPrefix - CIDR the rule matches, for example
192.168.1.0/24. Conflicts withremote_group_id. Changing this creates a new security group rule.
- direction str
- Direction of the traffic. Available values are
ingressoregress. Changing this creates a new security group rule. - ethertype str
- Internet protocol version of the rule. Available values are
IPv4orIPv6. 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_ strid - 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_ floatmax - Upper bound of the port range. Available values are from
0to65535. Withprotocol = "icmp", specifies the ICMP code from0to255. Learn more about Security group rules. Requiresprotocolandport_range_min. Changing this creates a new security group rule. - port_
range_ floatmin - Lower bound of the port range. Available values are from
0to65535. Withprotocol = "icmp", specifies the ICMP type from0to255and can be set withoutport_range_max. Learn more about Security group rules. Requiresprotocol. 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
0to255as 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_ strid - 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_ strprefix - CIDR the rule matches, for example
192.168.1.0/24. Conflicts withremote_group_id. Changing this creates a new security group rule.
- direction String
- Direction of the traffic. Available values are
ingressoregress. Changing this creates a new security group rule. - ethertype String
- Internet protocol version of the rule. Available values are
IPv4orIPv6. 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 StringId - 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 NumberMax - Upper bound of the port range. Available values are from
0to65535. Withprotocol = "icmp", specifies the ICMP code from0to255. Learn more about Security group rules. Requiresprotocolandport_range_min. Changing this creates a new security group rule. - port
Range NumberMin - Lower bound of the port range. Available values are from
0to65535. Withprotocol = "icmp", specifies the ICMP type from0to255and can be set withoutport_range_max. Learn more about Security group rules. Requiresprotocol. 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
0to255as 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 StringId - 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 StringPrefix - CIDR the rule matches, for example
192.168.1.0/24. Conflicts withremote_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) -> VpcSecgroupRuleV2func 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.
- Description string
- Description of the rule. Changing this creates a new security group rule.
- Direction string
- Direction of the traffic. Available values are
ingressoregress. Changing this creates a new security group rule. - Ethertype string
- Internet protocol version of the rule. Available values are
IPv4orIPv6. Changing this creates a new security group rule. - Port
Range doubleMax - Upper bound of the port range. Available values are from
0to65535. Withprotocol = "icmp", specifies the ICMP code from0to255. Learn more about Security group rules. Requiresprotocolandport_range_min. Changing this creates a new security group rule. - Port
Range doubleMin - Lower bound of the port range. Available values are from
0to65535. Withprotocol = "icmp", specifies the ICMP type from0to255and can be set withoutport_range_max. Learn more about Security group rules. Requiresprotocol. 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
0to255as 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 stringId - 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 stringPrefix - CIDR the rule matches, for example
192.168.1.0/24. Conflicts withremote_group_id. Changing this creates a new security group rule. - Security
Group stringId - 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
ingressoregress. Changing this creates a new security group rule. - Ethertype string
- Internet protocol version of the rule. Available values are
IPv4orIPv6. Changing this creates a new security group rule. - Port
Range float64Max - Upper bound of the port range. Available values are from
0to65535. Withprotocol = "icmp", specifies the ICMP code from0to255. Learn more about Security group rules. Requiresprotocolandport_range_min. Changing this creates a new security group rule. - Port
Range float64Min - Lower bound of the port range. Available values are from
0to65535. Withprotocol = "icmp", specifies the ICMP type from0to255and can be set withoutport_range_max. Learn more about Security group rules. Requiresprotocol. 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
0to255as 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 stringId - 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 stringPrefix - CIDR the rule matches, for example
192.168.1.0/24. Conflicts withremote_group_id. Changing this creates a new security group rule. - Security
Group stringId - 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
ingressoregress. Changing this creates a new security group rule. - ethertype string
- Internet protocol version of the rule. Available values are
IPv4orIPv6. Changing this creates a new security group rule. - port_
range_ numbermax - Upper bound of the port range. Available values are from
0to65535. Withprotocol = "icmp", specifies the ICMP code from0to255. Learn more about Security group rules. Requiresprotocolandport_range_min. Changing this creates a new security group rule. - port_
range_ numbermin - Lower bound of the port range. Available values are from
0to65535. Withprotocol = "icmp", specifies the ICMP type from0to255and can be set withoutport_range_max. Learn more about Security group rules. Requiresprotocol. 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
0to255as 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_ stringid - 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_ stringprefix - CIDR the rule matches, for example
192.168.1.0/24. Conflicts withremote_group_id. Changing this creates a new security group rule. - security_
group_ stringid - 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
ingressoregress. Changing this creates a new security group rule. - ethertype String
- Internet protocol version of the rule. Available values are
IPv4orIPv6. Changing this creates a new security group rule. - port
Range DoubleMax - Upper bound of the port range. Available values are from
0to65535. Withprotocol = "icmp", specifies the ICMP code from0to255. Learn more about Security group rules. Requiresprotocolandport_range_min. Changing this creates a new security group rule. - port
Range DoubleMin - Lower bound of the port range. Available values are from
0to65535. Withprotocol = "icmp", specifies the ICMP type from0to255and can be set withoutport_range_max. Learn more about Security group rules. Requiresprotocol. 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
0to255as 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 StringId - 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 StringPrefix - CIDR the rule matches, for example
192.168.1.0/24. Conflicts withremote_group_id. Changing this creates a new security group rule. - security
Group StringId - 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
ingressoregress. Changing this creates a new security group rule. - ethertype string
- Internet protocol version of the rule. Available values are
IPv4orIPv6. Changing this creates a new security group rule. - port
Range numberMax - Upper bound of the port range. Available values are from
0to65535. Withprotocol = "icmp", specifies the ICMP code from0to255. Learn more about Security group rules. Requiresprotocolandport_range_min. Changing this creates a new security group rule. - port
Range numberMin - Lower bound of the port range. Available values are from
0to65535. Withprotocol = "icmp", specifies the ICMP type from0to255and can be set withoutport_range_max. Learn more about Security group rules. Requiresprotocol. 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
0to255as 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 stringId - 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 stringPrefix - CIDR the rule matches, for example
192.168.1.0/24. Conflicts withremote_group_id. Changing this creates a new security group rule. - security
Group stringId - 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
ingressoregress. Changing this creates a new security group rule. - ethertype str
- Internet protocol version of the rule. Available values are
IPv4orIPv6. Changing this creates a new security group rule. - port_
range_ floatmax - Upper bound of the port range. Available values are from
0to65535. Withprotocol = "icmp", specifies the ICMP code from0to255. Learn more about Security group rules. Requiresprotocolandport_range_min. Changing this creates a new security group rule. - port_
range_ floatmin - Lower bound of the port range. Available values are from
0to65535. Withprotocol = "icmp", specifies the ICMP type from0to255and can be set withoutport_range_max. Learn more about Security group rules. Requiresprotocol. 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
0to255as 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_ strid - 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_ strprefix - CIDR the rule matches, for example
192.168.1.0/24. Conflicts withremote_group_id. Changing this creates a new security group rule. - security_
group_ strid - 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
ingressoregress. Changing this creates a new security group rule. - ethertype String
- Internet protocol version of the rule. Available values are
IPv4orIPv6. Changing this creates a new security group rule. - port
Range NumberMax - Upper bound of the port range. Available values are from
0to65535. Withprotocol = "icmp", specifies the ICMP code from0to255. Learn more about Security group rules. Requiresprotocolandport_range_min. Changing this creates a new security group rule. - port
Range NumberMin - Lower bound of the port range. Available values are from
0to65535. Withprotocol = "icmp", specifies the ICMP type from0to255and can be set withoutport_range_max. Learn more about Security group rules. Requiresprotocol. 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
0to255as 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 StringId - 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 StringPrefix - CIDR the rule matches, for example
192.168.1.0/24. Conflicts withremote_group_id. Changing this creates a new security group rule. - security
Group StringId - 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
selectelTerraform Provider.
published on Friday, Oct 30, 2026 by selectel