published on Friday, Oct 30, 2026 by selectel
published on Friday, Oct 30, 2026 by selectel
Creates and manages a single static route of a cloud router using the v2 public API. For more information about static routes, see the official Selectel documentation.
Do not manage the same router with both resources: selectel.VpcRouterRouteV2 and selectel.VpcRouterRoutesV2.
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.VpcRouterRouteV2("route_1", {
projectId: project1.id,
region: "ru-6",
routerId: router1.id,
destinationCidr: "10.0.0.0/8",
nextHop: "192.168.199.10",
}, {
dependsOn: [interface1],
});
import pulumi
import pulumi_selectel as selectel
route1 = selectel.VpcRouterRouteV2("route_1",
project_id=project1["id"],
region="ru-6",
router_id=router1["id"],
destination_cidr="10.0.0.0/8",
next_hop="192.168.199.10",
opts = pulumi.ResourceOptions(depends_on=[interface1]))
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.NewVpcRouterRouteV2(ctx, "route_1", &selectel.VpcRouterRouteV2Args{
ProjectId: pulumi.Any(project1.Id),
Region: pulumi.String("ru-6"),
RouterId: pulumi.Any(router1.Id),
DestinationCidr: pulumi.String("10.0.0.0/8"),
NextHop: pulumi.String("192.168.199.10"),
}, pulumi.DependsOn([]pulumi.Resource{
interface1,
}))
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.VpcRouterRouteV2("route_1", new()
{
ProjectId = project1.Id,
Region = "ru-6",
RouterId = router1.Id,
DestinationCidr = "10.0.0.0/8",
NextHop = "192.168.199.10",
}, new CustomResourceOptions
{
DependsOn =
{
interface1,
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.selectel.VpcRouterRouteV2;
import com.pulumi.selectel.VpcRouterRouteV2Args;
import com.pulumi.resources.CustomResourceOptions;
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 VpcRouterRouteV2("route1", VpcRouterRouteV2Args.builder()
.projectId(project1.id())
.region("ru-6")
.routerId(router1.id())
.destinationCidr("10.0.0.0/8")
.nextHop("192.168.199.10")
.build(), CustomResourceOptions.builder()
.dependsOn(interface1)
.build());
}
}
resources:
route1:
type: selectel:VpcRouterRouteV2
name: route_1
properties:
projectId: ${project1.id}
region: ru-6
routerId: ${router1.id}
destinationCidr: 10.0.0.0/8
nextHop: 192.168.199.10
options:
dependsOn:
- ${interface1}
Example coming soon!
Create VpcRouterRouteV2 Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new VpcRouterRouteV2(name: string, args: VpcRouterRouteV2Args, opts?: CustomResourceOptions);@overload
def VpcRouterRouteV2(resource_name: str,
args: VpcRouterRouteV2Args,
opts: Optional[ResourceOptions] = None)
@overload
def VpcRouterRouteV2(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,
router_id: Optional[str] = None)func NewVpcRouterRouteV2(ctx *Context, name string, args VpcRouterRouteV2Args, opts ...ResourceOption) (*VpcRouterRouteV2, error)public VpcRouterRouteV2(string name, VpcRouterRouteV2Args args, CustomResourceOptions? opts = null)
public VpcRouterRouteV2(String name, VpcRouterRouteV2Args args)
public VpcRouterRouteV2(String name, VpcRouterRouteV2Args args, CustomResourceOptions options)
type: selectel:VpcRouterRouteV2
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
resource "selectel_vpc_router_route_v2" "name" {
# resource properties
}Parameters
- name string
- The unique name of the resource.
- args VpcRouterRouteV2Args
- 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 VpcRouterRouteV2Args
- 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 VpcRouterRouteV2Args
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args VpcRouterRouteV2Args
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args VpcRouterRouteV2Args
- 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 vpcRouterRouteV2Resource = new Selectel.VpcRouterRouteV2("vpcRouterRouteV2Resource", new()
{
DestinationCidr = "string",
NextHop = "string",
ProjectId = "string",
Region = "string",
RouterId = "string",
});
example, err := selectel.NewVpcRouterRouteV2(ctx, "vpcRouterRouteV2Resource", &selectel.VpcRouterRouteV2Args{
DestinationCidr: pulumi.String("string"),
NextHop: pulumi.String("string"),
ProjectId: pulumi.String("string"),
Region: pulumi.String("string"),
RouterId: pulumi.String("string"),
})
resource "selectel_vpc_router_route_v2" "vpcRouterRouteV2Resource" {
lifecycle {
create_before_destroy = true
}
destination_cidr = "string"
next_hop = "string"
project_id = "string"
region = "string"
router_id = "string"
}
var vpcRouterRouteV2Resource = new VpcRouterRouteV2("vpcRouterRouteV2Resource", VpcRouterRouteV2Args.builder()
.destinationCidr("string")
.nextHop("string")
.projectId("string")
.region("string")
.routerId("string")
.build());
vpc_router_route_v2_resource = selectel.VpcRouterRouteV2("vpcRouterRouteV2Resource",
destination_cidr="string",
next_hop="string",
project_id="string",
region="string",
router_id="string")
const vpcRouterRouteV2Resource = new selectel.VpcRouterRouteV2("vpcRouterRouteV2Resource", {
destinationCidr: "string",
nextHop: "string",
projectId: "string",
region: "string",
routerId: "string",
});
type: selectel:VpcRouterRouteV2
properties:
destinationCidr: string
nextHop: string
projectId: string
region: string
routerId: string
VpcRouterRouteV2 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 VpcRouterRouteV2 resource accepts the following input properties:
- Destination
Cidr string - Destination CIDR of the route, for example,
10.0.0.0/8. Changing this creates a new route. - Next
Hop string - Next hop IP address for the route, for example,
192.168.199.10. Must be an address in a subnet connected to one of the router's internal interfaces. Cannot be an address from the router's external gateway subnet. Changing this creates a new 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 route. - Region string
- Pool where the route is located, for example,
ru-6. Learn more about available pools in Product availability by location. Changing this creates a new route. - Router
Id string - Unique identifier of the router the route belongs to. Retrieved from the selectelvpcrouter_v2 resource. Changing this creates a new route.
- Destination
Cidr string - Destination CIDR of the route, for example,
10.0.0.0/8. Changing this creates a new route. - Next
Hop string - Next hop IP address for the route, for example,
192.168.199.10. Must be an address in a subnet connected to one of the router's internal interfaces. Cannot be an address from the router's external gateway subnet. Changing this creates a new 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 route. - Region string
- Pool where the route is located, for example,
ru-6. Learn more about available pools in Product availability by location. Changing this creates a new route. - Router
Id string - Unique identifier of the router the route belongs to. Retrieved from the selectelvpcrouter_v2 resource. Changing this creates a new route.
- destination_
cidr string - Destination CIDR of the route, for example,
10.0.0.0/8. Changing this creates a new route. - next_
hop string - Next hop IP address for the route, for example,
192.168.199.10. Must be an address in a subnet connected to one of the router's internal interfaces. Cannot be an address from the router's external gateway subnet. Changing this creates a new 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 route. - region string
- Pool where the route is located, for example,
ru-6. Learn more about available pools in Product availability by location. Changing this creates a new route. - router_
id string - Unique identifier of the router the route belongs to. Retrieved from the selectelvpcrouter_v2 resource. Changing this creates a new route.
- destination
Cidr String - Destination CIDR of the route, for example,
10.0.0.0/8. Changing this creates a new route. - next
Hop String - Next hop IP address for the route, for example,
192.168.199.10. Must be an address in a subnet connected to one of the router's internal interfaces. Cannot be an address from the router's external gateway subnet. Changing this creates a new 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 route. - region String
- Pool where the route is located, for example,
ru-6. Learn more about available pools in Product availability by location. Changing this creates a new route. - router
Id String - Unique identifier of the router the route belongs to. Retrieved from the selectelvpcrouter_v2 resource. Changing this creates a new route.
- destination
Cidr string - Destination CIDR of the route, for example,
10.0.0.0/8. Changing this creates a new route. - next
Hop string - Next hop IP address for the route, for example,
192.168.199.10. Must be an address in a subnet connected to one of the router's internal interfaces. Cannot be an address from the router's external gateway subnet. Changing this creates a new 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 route. - region string
- Pool where the route is located, for example,
ru-6. Learn more about available pools in Product availability by location. Changing this creates a new route. - router
Id string - Unique identifier of the router the route belongs to. Retrieved from the selectelvpcrouter_v2 resource. Changing this creates a new route.
- destination_
cidr str - Destination CIDR of the route, for example,
10.0.0.0/8. Changing this creates a new route. - next_
hop str - Next hop IP address for the route, for example,
192.168.199.10. Must be an address in a subnet connected to one of the router's internal interfaces. Cannot be an address from the router's external gateway subnet. Changing this creates a new 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 route. - region str
- Pool where the route is located, for example,
ru-6. Learn more about available pools in Product availability by location. Changing this creates a new route. - router_
id str - Unique identifier of the router the route belongs to. Retrieved from the selectelvpcrouter_v2 resource. Changing this creates a new route.
- destination
Cidr String - Destination CIDR of the route, for example,
10.0.0.0/8. Changing this creates a new route. - next
Hop String - Next hop IP address for the route, for example,
192.168.199.10. Must be an address in a subnet connected to one of the router's internal interfaces. Cannot be an address from the router's external gateway subnet. Changing this creates a new 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 route. - region String
- Pool where the route is located, for example,
ru-6. Learn more about available pools in Product availability by location. Changing this creates a new route. - router
Id String - Unique identifier of the router the route belongs to. Retrieved from the selectelvpcrouter_v2 resource. Changing this creates a new route.
Outputs
All input properties are implicitly available as output properties. Additionally, the VpcRouterRouteV2 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 VpcRouterRouteV2 Resource
Get an existing VpcRouterRouteV2 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?: VpcRouterRouteV2State, opts?: CustomResourceOptions): VpcRouterRouteV2@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,
router_id: Optional[str] = None) -> VpcRouterRouteV2func GetVpcRouterRouteV2(ctx *Context, name string, id IDInput, state *VpcRouterRouteV2State, opts ...ResourceOption) (*VpcRouterRouteV2, error)public static VpcRouterRouteV2 Get(string name, Input<string> id, VpcRouterRouteV2State? state, CustomResourceOptions? opts = null)public static VpcRouterRouteV2 get(String name, Output<String> id, VpcRouterRouteV2State state, CustomResourceOptions options)resources: _: type: selectel:VpcRouterRouteV2 get: id: ${id}import {
to = selectel_vpc_router_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.
- Destination
Cidr string - Destination CIDR of the route, for example,
10.0.0.0/8. Changing this creates a new route. - Next
Hop string - Next hop IP address for the route, for example,
192.168.199.10. Must be an address in a subnet connected to one of the router's internal interfaces. Cannot be an address from the router's external gateway subnet. Changing this creates a new 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 route. - Region string
- Pool where the route is located, for example,
ru-6. Learn more about available pools in Product availability by location. Changing this creates a new route. - Router
Id string - Unique identifier of the router the route belongs to. Retrieved from the selectelvpcrouter_v2 resource. Changing this creates a new route.
- Destination
Cidr string - Destination CIDR of the route, for example,
10.0.0.0/8. Changing this creates a new route. - Next
Hop string - Next hop IP address for the route, for example,
192.168.199.10. Must be an address in a subnet connected to one of the router's internal interfaces. Cannot be an address from the router's external gateway subnet. Changing this creates a new 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 route. - Region string
- Pool where the route is located, for example,
ru-6. Learn more about available pools in Product availability by location. Changing this creates a new route. - Router
Id string - Unique identifier of the router the route belongs to. Retrieved from the selectelvpcrouter_v2 resource. Changing this creates a new route.
- destination_
cidr string - Destination CIDR of the route, for example,
10.0.0.0/8. Changing this creates a new route. - next_
hop string - Next hop IP address for the route, for example,
192.168.199.10. Must be an address in a subnet connected to one of the router's internal interfaces. Cannot be an address from the router's external gateway subnet. Changing this creates a new 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 route. - region string
- Pool where the route is located, for example,
ru-6. Learn more about available pools in Product availability by location. Changing this creates a new route. - router_
id string - Unique identifier of the router the route belongs to. Retrieved from the selectelvpcrouter_v2 resource. Changing this creates a new route.
- destination
Cidr String - Destination CIDR of the route, for example,
10.0.0.0/8. Changing this creates a new route. - next
Hop String - Next hop IP address for the route, for example,
192.168.199.10. Must be an address in a subnet connected to one of the router's internal interfaces. Cannot be an address from the router's external gateway subnet. Changing this creates a new 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 route. - region String
- Pool where the route is located, for example,
ru-6. Learn more about available pools in Product availability by location. Changing this creates a new route. - router
Id String - Unique identifier of the router the route belongs to. Retrieved from the selectelvpcrouter_v2 resource. Changing this creates a new route.
- destination
Cidr string - Destination CIDR of the route, for example,
10.0.0.0/8. Changing this creates a new route. - next
Hop string - Next hop IP address for the route, for example,
192.168.199.10. Must be an address in a subnet connected to one of the router's internal interfaces. Cannot be an address from the router's external gateway subnet. Changing this creates a new 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 route. - region string
- Pool where the route is located, for example,
ru-6. Learn more about available pools in Product availability by location. Changing this creates a new route. - router
Id string - Unique identifier of the router the route belongs to. Retrieved from the selectelvpcrouter_v2 resource. Changing this creates a new route.
- destination_
cidr str - Destination CIDR of the route, for example,
10.0.0.0/8. Changing this creates a new route. - next_
hop str - Next hop IP address for the route, for example,
192.168.199.10. Must be an address in a subnet connected to one of the router's internal interfaces. Cannot be an address from the router's external gateway subnet. Changing this creates a new 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 route. - region str
- Pool where the route is located, for example,
ru-6. Learn more about available pools in Product availability by location. Changing this creates a new route. - router_
id str - Unique identifier of the router the route belongs to. Retrieved from the selectelvpcrouter_v2 resource. Changing this creates a new route.
- destination
Cidr String - Destination CIDR of the route, for example,
10.0.0.0/8. Changing this creates a new route. - next
Hop String - Next hop IP address for the route, for example,
192.168.199.10. Must be an address in a subnet connected to one of the router's internal interfaces. Cannot be an address from the router's external gateway subnet. Changing this creates a new 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 route. - region String
- Pool where the route is located, for example,
ru-6. Learn more about available pools in Product availability by location. Changing this creates a new route. - router
Id String - Unique identifier of the router the route belongs to. Retrieved from the selectelvpcrouter_v2 resource. Changing this creates a new 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/vpcRouterRouteV2:VpcRouterRouteV2 route_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