1. Registry
  2. Packages
  3. Selectel Provider
  4. API Docs
  5. VpcNetworkSubnetRouteV2
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 single route of a subnet using the v2 public API. For more information about static routes, see the official Selectel documentation.

    The resource manages a single entry of the subnet’s host_routes list and leaves the other entries alone. Do not manage the same routes both with this resource and the host_routes argument of selectel.VpcNetworkSubnetV2.

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

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as selectel from "@pulumi/selectel";
    
    const route1 = new selectel.VpcNetworkSubnetRouteV2("route_1", {
        projectId: project1.id,
        region: "ru-6",
        subnetId: subnet1.id,
        destinationCidr: "10.0.0.0/8",
        nextHop: "192.168.199.10",
    });
    
    import pulumi
    import pulumi_selectel as selectel
    
    route1 = selectel.VpcNetworkSubnetRouteV2("route_1",
        project_id=project1["id"],
        region="ru-6",
        subnet_id=subnet1["id"],
        destination_cidr="10.0.0.0/8",
        next_hop="192.168.199.10")
    
    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.NewVpcNetworkSubnetRouteV2(ctx, "route_1", &selectel.VpcNetworkSubnetRouteV2Args{
    			ProjectId:       pulumi.Any(project1.Id),
    			Region:          pulumi.String("ru-6"),
    			SubnetId:        pulumi.Any(subnet1.Id),
    			DestinationCidr: pulumi.String("10.0.0.0/8"),
    			NextHop:         pulumi.String("192.168.199.10"),
    		})
    		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 route1 = new Selectel.VpcNetworkSubnetRouteV2("route_1", new()
        {
            ProjectId = project1.Id,
            Region = "ru-6",
            SubnetId = subnet1.Id,
            DestinationCidr = "10.0.0.0/8",
            NextHop = "192.168.199.10",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.selectel.VpcNetworkSubnetRouteV2;
    import com.pulumi.selectel.VpcNetworkSubnetRouteV2Args;
    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 route1 = new VpcNetworkSubnetRouteV2("route1", VpcNetworkSubnetRouteV2Args.builder()
                .projectId(project1.id())
                .region("ru-6")
                .subnetId(subnet1.id())
                .destinationCidr("10.0.0.0/8")
                .nextHop("192.168.199.10")
                .build());
    
        }
    }
    
    resources:
      route1:
        type: selectel:VpcNetworkSubnetRouteV2
        name: route_1
        properties:
          projectId: ${project1.id}
          region: ru-6
          subnetId: ${subnet1.id}
          destinationCidr: 10.0.0.0/8
          nextHop: 192.168.199.10
    
    Example coming soon!
    

    Create VpcNetworkSubnetRouteV2 Resource

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

    Constructor syntax

    new VpcNetworkSubnetRouteV2(name: string, args: VpcNetworkSubnetRouteV2Args, opts?: CustomResourceOptions);
    @overload
    def VpcNetworkSubnetRouteV2(resource_name: str,
                                args: VpcNetworkSubnetRouteV2Args,
                                opts: Optional[ResourceOptions] = None)
    
    @overload
    def VpcNetworkSubnetRouteV2(resource_name: str,
                                opts: Optional[ResourceOptions] = None,
                                destination_cidr: Optional[str] = None,
                                next_hop: Optional[str] = None,
                                project_id: Optional[str] = None,
                                region: Optional[str] = None,
                                subnet_id: Optional[str] = None)
    func NewVpcNetworkSubnetRouteV2(ctx *Context, name string, args VpcNetworkSubnetRouteV2Args, opts ...ResourceOption) (*VpcNetworkSubnetRouteV2, error)
    public VpcNetworkSubnetRouteV2(string name, VpcNetworkSubnetRouteV2Args args, CustomResourceOptions? opts = null)
    public VpcNetworkSubnetRouteV2(String name, VpcNetworkSubnetRouteV2Args args)
    public VpcNetworkSubnetRouteV2(String name, VpcNetworkSubnetRouteV2Args args, CustomResourceOptions options)
    
    type: selectel:VpcNetworkSubnetRouteV2
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    resource "selectel_vpc_network_subnet_route_v2" "name" {
        # resource properties
    }

    Parameters

    name string
    The unique name of the resource.
    args VpcNetworkSubnetRouteV2Args
    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 VpcNetworkSubnetRouteV2Args
    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 VpcNetworkSubnetRouteV2Args
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args VpcNetworkSubnetRouteV2Args
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args VpcNetworkSubnetRouteV2Args
    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 vpcNetworkSubnetRouteV2Resource = new Selectel.VpcNetworkSubnetRouteV2("vpcNetworkSubnetRouteV2Resource", new()
    {
        DestinationCidr = "string",
        NextHop = "string",
        ProjectId = "string",
        Region = "string",
        SubnetId = "string",
    });
    
    example, err := selectel.NewVpcNetworkSubnetRouteV2(ctx, "vpcNetworkSubnetRouteV2Resource", &selectel.VpcNetworkSubnetRouteV2Args{
    	DestinationCidr: pulumi.String("string"),
    	NextHop:         pulumi.String("string"),
    	ProjectId:       pulumi.String("string"),
    	Region:          pulumi.String("string"),
    	SubnetId:        pulumi.String("string"),
    })
    
    resource "selectel_vpc_network_subnet_route_v2" "vpcNetworkSubnetRouteV2Resource" {
      lifecycle {
        create_before_destroy = true
      }
      destination_cidr = "string"
      next_hop         = "string"
      project_id       = "string"
      region           = "string"
      subnet_id        = "string"
    }
    
    var vpcNetworkSubnetRouteV2Resource = new VpcNetworkSubnetRouteV2("vpcNetworkSubnetRouteV2Resource", VpcNetworkSubnetRouteV2Args.builder()
        .destinationCidr("string")
        .nextHop("string")
        .projectId("string")
        .region("string")
        .subnetId("string")
        .build());
    
    vpc_network_subnet_route_v2_resource = selectel.VpcNetworkSubnetRouteV2("vpcNetworkSubnetRouteV2Resource",
        destination_cidr="string",
        next_hop="string",
        project_id="string",
        region="string",
        subnet_id="string")
    
    const vpcNetworkSubnetRouteV2Resource = new selectel.VpcNetworkSubnetRouteV2("vpcNetworkSubnetRouteV2Resource", {
        destinationCidr: "string",
        nextHop: "string",
        projectId: "string",
        region: "string",
        subnetId: "string",
    });
    
    type: selectel:VpcNetworkSubnetRouteV2
    properties:
        destinationCidr: string
        nextHop: string
        projectId: string
        region: string
        subnetId: string
    

    VpcNetworkSubnetRouteV2 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 VpcNetworkSubnetRouteV2 resource accepts the following input properties:

    DestinationCidr string
    Destination CIDR of the route, for example, 10.0.0.0/8. Changing this creates a new subnet route.
    NextHop string
    IP address of the next hop gateway, for example, 192.168.199.10. Changing this creates a new subnet route.
    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 subnet route.
    Region string
    Pool where the subnet route is located, for example, ru-6. Learn more about available pools in Product availability by location. Changing this creates a new subnet route.
    SubnetId string
    Unique identifier of the subnet the route belongs to. Retrieved from the selectelvpcnetworksubnetv2 resource. Changing this creates a new subnet route.
    DestinationCidr string
    Destination CIDR of the route, for example, 10.0.0.0/8. Changing this creates a new subnet route.
    NextHop string
    IP address of the next hop gateway, for example, 192.168.199.10. Changing this creates a new subnet route.
    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 subnet route.
    Region string
    Pool where the subnet route is located, for example, ru-6. Learn more about available pools in Product availability by location. Changing this creates a new subnet route.
    SubnetId string
    Unique identifier of the subnet the route belongs to. Retrieved from the selectelvpcnetworksubnetv2 resource. Changing this creates a new subnet route.
    destination_cidr string
    Destination CIDR of the route, for example, 10.0.0.0/8. Changing this creates a new subnet route.
    next_hop string
    IP address of the next hop gateway, for example, 192.168.199.10. Changing this creates a new subnet route.
    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 subnet route.
    region string
    Pool where the subnet route is located, for example, ru-6. Learn more about available pools in Product availability by location. Changing this creates a new subnet route.
    subnet_id string
    Unique identifier of the subnet the route belongs to. Retrieved from the selectelvpcnetworksubnetv2 resource. Changing this creates a new subnet route.
    destinationCidr String
    Destination CIDR of the route, for example, 10.0.0.0/8. Changing this creates a new subnet route.
    nextHop String
    IP address of the next hop gateway, for example, 192.168.199.10. Changing this creates a new subnet route.
    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 subnet route.
    region String
    Pool where the subnet route is located, for example, ru-6. Learn more about available pools in Product availability by location. Changing this creates a new subnet route.
    subnetId String
    Unique identifier of the subnet the route belongs to. Retrieved from the selectelvpcnetworksubnetv2 resource. Changing this creates a new subnet route.
    destinationCidr string
    Destination CIDR of the route, for example, 10.0.0.0/8. Changing this creates a new subnet route.
    nextHop string
    IP address of the next hop gateway, for example, 192.168.199.10. Changing this creates a new subnet route.
    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 subnet route.
    region string
    Pool where the subnet route is located, for example, ru-6. Learn more about available pools in Product availability by location. Changing this creates a new subnet route.
    subnetId string
    Unique identifier of the subnet the route belongs to. Retrieved from the selectelvpcnetworksubnetv2 resource. Changing this creates a new subnet route.
    destination_cidr str
    Destination CIDR of the route, for example, 10.0.0.0/8. Changing this creates a new subnet route.
    next_hop str
    IP address of the next hop gateway, for example, 192.168.199.10. Changing this creates a new subnet route.
    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 subnet route.
    region str
    Pool where the subnet route is located, for example, ru-6. Learn more about available pools in Product availability by location. Changing this creates a new subnet route.
    subnet_id str
    Unique identifier of the subnet the route belongs to. Retrieved from the selectelvpcnetworksubnetv2 resource. Changing this creates a new subnet route.
    destinationCidr String
    Destination CIDR of the route, for example, 10.0.0.0/8. Changing this creates a new subnet route.
    nextHop String
    IP address of the next hop gateway, for example, 192.168.199.10. Changing this creates a new subnet route.
    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 subnet route.
    region String
    Pool where the subnet route is located, for example, ru-6. Learn more about available pools in Product availability by location. Changing this creates a new subnet route.
    subnetId String
    Unique identifier of the subnet the route belongs to. Retrieved from the selectelvpcnetworksubnetv2 resource. Changing this creates a new subnet route.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the VpcNetworkSubnetRouteV2 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 VpcNetworkSubnetRouteV2 Resource

    Get an existing VpcNetworkSubnetRouteV2 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?: VpcNetworkSubnetRouteV2State, opts?: CustomResourceOptions): VpcNetworkSubnetRouteV2
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            destination_cidr: Optional[str] = None,
            next_hop: Optional[str] = None,
            project_id: Optional[str] = None,
            region: Optional[str] = None,
            subnet_id: Optional[str] = None) -> VpcNetworkSubnetRouteV2
    func GetVpcNetworkSubnetRouteV2(ctx *Context, name string, id IDInput, state *VpcNetworkSubnetRouteV2State, opts ...ResourceOption) (*VpcNetworkSubnetRouteV2, error)
    public static VpcNetworkSubnetRouteV2 Get(string name, Input<string> id, VpcNetworkSubnetRouteV2State? state, CustomResourceOptions? opts = null)
    public static VpcNetworkSubnetRouteV2 get(String name, Output<String> id, VpcNetworkSubnetRouteV2State state, CustomResourceOptions options)
    resources:  _:    type: selectel:VpcNetworkSubnetRouteV2    get:      id: ${id}
    import {
      to = selectel_vpc_network_subnet_route_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:
    DestinationCidr string
    Destination CIDR of the route, for example, 10.0.0.0/8. Changing this creates a new subnet route.
    NextHop string
    IP address of the next hop gateway, for example, 192.168.199.10. Changing this creates a new subnet route.
    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 subnet route.
    Region string
    Pool where the subnet route is located, for example, ru-6. Learn more about available pools in Product availability by location. Changing this creates a new subnet route.
    SubnetId string
    Unique identifier of the subnet the route belongs to. Retrieved from the selectelvpcnetworksubnetv2 resource. Changing this creates a new subnet route.
    DestinationCidr string
    Destination CIDR of the route, for example, 10.0.0.0/8. Changing this creates a new subnet route.
    NextHop string
    IP address of the next hop gateway, for example, 192.168.199.10. Changing this creates a new subnet route.
    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 subnet route.
    Region string
    Pool where the subnet route is located, for example, ru-6. Learn more about available pools in Product availability by location. Changing this creates a new subnet route.
    SubnetId string
    Unique identifier of the subnet the route belongs to. Retrieved from the selectelvpcnetworksubnetv2 resource. Changing this creates a new subnet route.
    destination_cidr string
    Destination CIDR of the route, for example, 10.0.0.0/8. Changing this creates a new subnet route.
    next_hop string
    IP address of the next hop gateway, for example, 192.168.199.10. Changing this creates a new subnet route.
    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 subnet route.
    region string
    Pool where the subnet route is located, for example, ru-6. Learn more about available pools in Product availability by location. Changing this creates a new subnet route.
    subnet_id string
    Unique identifier of the subnet the route belongs to. Retrieved from the selectelvpcnetworksubnetv2 resource. Changing this creates a new subnet route.
    destinationCidr String
    Destination CIDR of the route, for example, 10.0.0.0/8. Changing this creates a new subnet route.
    nextHop String
    IP address of the next hop gateway, for example, 192.168.199.10. Changing this creates a new subnet route.
    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 subnet route.
    region String
    Pool where the subnet route is located, for example, ru-6. Learn more about available pools in Product availability by location. Changing this creates a new subnet route.
    subnetId String
    Unique identifier of the subnet the route belongs to. Retrieved from the selectelvpcnetworksubnetv2 resource. Changing this creates a new subnet route.
    destinationCidr string
    Destination CIDR of the route, for example, 10.0.0.0/8. Changing this creates a new subnet route.
    nextHop string
    IP address of the next hop gateway, for example, 192.168.199.10. Changing this creates a new subnet route.
    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 subnet route.
    region string
    Pool where the subnet route is located, for example, ru-6. Learn more about available pools in Product availability by location. Changing this creates a new subnet route.
    subnetId string
    Unique identifier of the subnet the route belongs to. Retrieved from the selectelvpcnetworksubnetv2 resource. Changing this creates a new subnet route.
    destination_cidr str
    Destination CIDR of the route, for example, 10.0.0.0/8. Changing this creates a new subnet route.
    next_hop str
    IP address of the next hop gateway, for example, 192.168.199.10. Changing this creates a new subnet route.
    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 subnet route.
    region str
    Pool where the subnet route is located, for example, ru-6. Learn more about available pools in Product availability by location. Changing this creates a new subnet route.
    subnet_id str
    Unique identifier of the subnet the route belongs to. Retrieved from the selectelvpcnetworksubnetv2 resource. Changing this creates a new subnet route.
    destinationCidr String
    Destination CIDR of the route, for example, 10.0.0.0/8. Changing this creates a new subnet route.
    nextHop String
    IP address of the next hop gateway, for example, 192.168.199.10. Changing this creates a new subnet route.
    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 subnet route.
    region String
    Pool where the subnet route is located, for example, ru-6. Learn more about available pools in Product availability by location. Changing this creates a new subnet route.
    subnetId String
    Unique identifier of the subnet the route belongs to. Retrieved from the selectelvpcnetworksubnetv2 resource. Changing this creates a new subnet route.

    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/vpcNetworkSubnetRouteV2:VpcNetworkSubnetRouteV2 route_1 <subnet_id>-route-<destination_cidr>-<next_hop>
    

    <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