1. Registry
  2. Packages
  3. Selectel Provider
  4. API Docs
  5. VpcRouterRoutesV2
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 the complete set of static routes 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 routes1 = new selectel.VpcRouterRoutesV2("routes_1", {
        projectId: project1.id,
        region: "ru-6",
        routerId: router1.id,
        routes: [
            {
                destinationCidr: "10.0.0.0/8",
                nextHop: "192.168.199.10",
            },
            {
                destinationCidr: "172.16.0.0/12",
                nextHop: "192.168.199.10",
            },
        ],
    }, {
        dependsOn: [interface1],
    });
    
    import pulumi
    import pulumi_selectel as selectel
    
    routes1 = selectel.VpcRouterRoutesV2("routes_1",
        project_id=project1["id"],
        region="ru-6",
        router_id=router1["id"],
        routes=[
            {
                "destination_cidr": "10.0.0.0/8",
                "next_hop": "192.168.199.10",
            },
            {
                "destination_cidr": "172.16.0.0/12",
                "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.NewVpcRouterRoutesV2(ctx, "routes_1", &selectel.VpcRouterRoutesV2Args{
    			ProjectId: pulumi.Any(project1.Id),
    			Region:    pulumi.String("ru-6"),
    			RouterId:  pulumi.Any(router1.Id),
    			Routes: selectel.VpcRouterRoutesV2RouteArray{
    				&selectel.VpcRouterRoutesV2RouteArgs{
    					DestinationCidr: pulumi.String("10.0.0.0/8"),
    					NextHop:         pulumi.String("192.168.199.10"),
    				},
    				&selectel.VpcRouterRoutesV2RouteArgs{
    					DestinationCidr: pulumi.String("172.16.0.0/12"),
    					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 routes1 = new Selectel.VpcRouterRoutesV2("routes_1", new()
        {
            ProjectId = project1.Id,
            Region = "ru-6",
            RouterId = router1.Id,
            Routes = new[]
            {
                new Selectel.Inputs.VpcRouterRoutesV2RouteArgs
                {
                    DestinationCidr = "10.0.0.0/8",
                    NextHop = "192.168.199.10",
                },
                new Selectel.Inputs.VpcRouterRoutesV2RouteArgs
                {
                    DestinationCidr = "172.16.0.0/12",
                    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.VpcRouterRoutesV2;
    import com.pulumi.selectel.VpcRouterRoutesV2Args;
    import com.pulumi.selectel.inputs.VpcRouterRoutesV2RouteArgs;
    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 routes1 = new VpcRouterRoutesV2("routes1", VpcRouterRoutesV2Args.builder()
                .projectId(project1.id())
                .region("ru-6")
                .routerId(router1.id())
                .routes(            
                    VpcRouterRoutesV2RouteArgs.builder()
                        .destinationCidr("10.0.0.0/8")
                        .nextHop("192.168.199.10")
                        .build(),
                    VpcRouterRoutesV2RouteArgs.builder()
                        .destinationCidr("172.16.0.0/12")
                        .nextHop("192.168.199.10")
                        .build())
                .build(), CustomResourceOptions.builder()
                    .dependsOn(interface1)
                    .build());
    
        }
    }
    
    resources:
      routes1:
        type: selectel:VpcRouterRoutesV2
        name: routes_1
        properties:
          projectId: ${project1.id}
          region: ru-6
          routerId: ${router1.id}
          routes:
            - destinationCidr: 10.0.0.0/8
              nextHop: 192.168.199.10
            - destinationCidr: 172.16.0.0/12
              nextHop: 192.168.199.10
        options:
          dependsOn:
            - ${interface1}
    
    Example coming soon!
    

    Create VpcRouterRoutesV2 Resource

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

    Constructor syntax

    new VpcRouterRoutesV2(name: string, args: VpcRouterRoutesV2Args, opts?: CustomResourceOptions);
    @overload
    def VpcRouterRoutesV2(resource_name: str,
                          args: VpcRouterRoutesV2Args,
                          opts: Optional[ResourceOptions] = None)
    
    @overload
    def VpcRouterRoutesV2(resource_name: str,
                          opts: Optional[ResourceOptions] = None,
                          project_id: Optional[str] = None,
                          region: Optional[str] = None,
                          router_id: Optional[str] = None,
                          routes: Optional[Sequence[VpcRouterRoutesV2RouteArgs]] = None)
    func NewVpcRouterRoutesV2(ctx *Context, name string, args VpcRouterRoutesV2Args, opts ...ResourceOption) (*VpcRouterRoutesV2, error)
    public VpcRouterRoutesV2(string name, VpcRouterRoutesV2Args args, CustomResourceOptions? opts = null)
    public VpcRouterRoutesV2(String name, VpcRouterRoutesV2Args args)
    public VpcRouterRoutesV2(String name, VpcRouterRoutesV2Args args, CustomResourceOptions options)
    
    type: selectel:VpcRouterRoutesV2
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    resource "selectel_vpc_router_routes_v2" "name" {
        # resource properties
    }

    Parameters

    name string
    The unique name of the resource.
    args VpcRouterRoutesV2Args
    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 VpcRouterRoutesV2Args
    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 VpcRouterRoutesV2Args
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args VpcRouterRoutesV2Args
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args VpcRouterRoutesV2Args
    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 vpcRouterRoutesV2Resource = new Selectel.VpcRouterRoutesV2("vpcRouterRoutesV2Resource", new()
    {
        ProjectId = "string",
        Region = "string",
        RouterId = "string",
        Routes = new[]
        {
            new Selectel.Inputs.VpcRouterRoutesV2RouteArgs
            {
                DestinationCidr = "string",
                NextHop = "string",
            },
        },
    });
    
    example, err := selectel.NewVpcRouterRoutesV2(ctx, "vpcRouterRoutesV2Resource", &selectel.VpcRouterRoutesV2Args{
    	ProjectId: pulumi.String("string"),
    	Region:    pulumi.String("string"),
    	RouterId:  pulumi.String("string"),
    	Routes: selectel.VpcRouterRoutesV2RouteArray{
    		&selectel.VpcRouterRoutesV2RouteArgs{
    			DestinationCidr: pulumi.String("string"),
    			NextHop:         pulumi.String("string"),
    		},
    	},
    })
    
    resource "selectel_vpc_router_routes_v2" "vpcRouterRoutesV2Resource" {
      lifecycle {
        create_before_destroy = true
      }
      project_id = "string"
      region     = "string"
      router_id  = "string"
      routes {
        destination_cidr = "string"
        next_hop         = "string"
      }
    }
    
    var vpcRouterRoutesV2Resource = new VpcRouterRoutesV2("vpcRouterRoutesV2Resource", VpcRouterRoutesV2Args.builder()
        .projectId("string")
        .region("string")
        .routerId("string")
        .routes(VpcRouterRoutesV2RouteArgs.builder()
            .destinationCidr("string")
            .nextHop("string")
            .build())
        .build());
    
    vpc_router_routes_v2_resource = selectel.VpcRouterRoutesV2("vpcRouterRoutesV2Resource",
        project_id="string",
        region="string",
        router_id="string",
        routes=[{
            "destination_cidr": "string",
            "next_hop": "string",
        }])
    
    const vpcRouterRoutesV2Resource = new selectel.VpcRouterRoutesV2("vpcRouterRoutesV2Resource", {
        projectId: "string",
        region: "string",
        routerId: "string",
        routes: [{
            destinationCidr: "string",
            nextHop: "string",
        }],
    });
    
    type: selectel:VpcRouterRoutesV2
    properties:
        projectId: string
        region: string
        routerId: string
        routes:
            - destinationCidr: string
              nextHop: string
    

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

    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 route set.
    Region string
    Pool where the route set is located, for example, ru-6. Learn more about available pools in Product availability by location. Changing this creates a new route set.
    RouterId string
    Unique identifier of the router whose routes are managed. Retrieved from the selectelvpcrouter_v2 resource. Changing this creates a new route set.
    Routes List<VpcRouterRoutesV2Route>
    Static routes to add to the router.
    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 route set.
    Region string
    Pool where the route set is located, for example, ru-6. Learn more about available pools in Product availability by location. Changing this creates a new route set.
    RouterId string
    Unique identifier of the router whose routes are managed. Retrieved from the selectelvpcrouter_v2 resource. Changing this creates a new route set.
    Routes []VpcRouterRoutesV2RouteArgs
    Static routes to add to the router.
    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 set.
    region string
    Pool where the route set is located, for example, ru-6. Learn more about available pools in Product availability by location. Changing this creates a new route set.
    router_id string
    Unique identifier of the router whose routes are managed. Retrieved from the selectelvpcrouter_v2 resource. Changing this creates a new route set.
    routes list(object)
    Static routes to add to the router.
    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 route set.
    region String
    Pool where the route set is located, for example, ru-6. Learn more about available pools in Product availability by location. Changing this creates a new route set.
    routerId String
    Unique identifier of the router whose routes are managed. Retrieved from the selectelvpcrouter_v2 resource. Changing this creates a new route set.
    routes List<VpcRouterRoutesV2Route>
    Static routes to add to the router.
    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 route set.
    region string
    Pool where the route set is located, for example, ru-6. Learn more about available pools in Product availability by location. Changing this creates a new route set.
    routerId string
    Unique identifier of the router whose routes are managed. Retrieved from the selectelvpcrouter_v2 resource. Changing this creates a new route set.
    routes VpcRouterRoutesV2Route[]
    Static routes to add to the router.
    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 set.
    region str
    Pool where the route set is located, for example, ru-6. Learn more about available pools in Product availability by location. Changing this creates a new route set.
    router_id str
    Unique identifier of the router whose routes are managed. Retrieved from the selectelvpcrouter_v2 resource. Changing this creates a new route set.
    routes Sequence[VpcRouterRoutesV2RouteArgs]
    Static routes to add to the router.
    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 route set.
    region String
    Pool where the route set is located, for example, ru-6. Learn more about available pools in Product availability by location. Changing this creates a new route set.
    routerId String
    Unique identifier of the router whose routes are managed. Retrieved from the selectelvpcrouter_v2 resource. Changing this creates a new route set.
    routes List<Property Map>
    Static routes to add to the router.

    Outputs

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

    Get an existing VpcRouterRoutesV2 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?: VpcRouterRoutesV2State, opts?: CustomResourceOptions): VpcRouterRoutesV2
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            project_id: Optional[str] = None,
            region: Optional[str] = None,
            router_id: Optional[str] = None,
            routes: Optional[Sequence[VpcRouterRoutesV2RouteArgs]] = None) -> VpcRouterRoutesV2
    func GetVpcRouterRoutesV2(ctx *Context, name string, id IDInput, state *VpcRouterRoutesV2State, opts ...ResourceOption) (*VpcRouterRoutesV2, error)
    public static VpcRouterRoutesV2 Get(string name, Input<string> id, VpcRouterRoutesV2State? state, CustomResourceOptions? opts = null)
    public static VpcRouterRoutesV2 get(String name, Output<String> id, VpcRouterRoutesV2State state, CustomResourceOptions options)
    resources:  _:    type: selectel:VpcRouterRoutesV2    get:      id: ${id}
    import {
      to = selectel_vpc_router_routes_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:
    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 route set.
    Region string
    Pool where the route set is located, for example, ru-6. Learn more about available pools in Product availability by location. Changing this creates a new route set.
    RouterId string
    Unique identifier of the router whose routes are managed. Retrieved from the selectelvpcrouter_v2 resource. Changing this creates a new route set.
    Routes List<VpcRouterRoutesV2Route>
    Static routes to add to the router.
    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 route set.
    Region string
    Pool where the route set is located, for example, ru-6. Learn more about available pools in Product availability by location. Changing this creates a new route set.
    RouterId string
    Unique identifier of the router whose routes are managed. Retrieved from the selectelvpcrouter_v2 resource. Changing this creates a new route set.
    Routes []VpcRouterRoutesV2RouteArgs
    Static routes to add to the router.
    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 set.
    region string
    Pool where the route set is located, for example, ru-6. Learn more about available pools in Product availability by location. Changing this creates a new route set.
    router_id string
    Unique identifier of the router whose routes are managed. Retrieved from the selectelvpcrouter_v2 resource. Changing this creates a new route set.
    routes list(object)
    Static routes to add to the router.
    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 route set.
    region String
    Pool where the route set is located, for example, ru-6. Learn more about available pools in Product availability by location. Changing this creates a new route set.
    routerId String
    Unique identifier of the router whose routes are managed. Retrieved from the selectelvpcrouter_v2 resource. Changing this creates a new route set.
    routes List<VpcRouterRoutesV2Route>
    Static routes to add to the router.
    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 route set.
    region string
    Pool where the route set is located, for example, ru-6. Learn more about available pools in Product availability by location. Changing this creates a new route set.
    routerId string
    Unique identifier of the router whose routes are managed. Retrieved from the selectelvpcrouter_v2 resource. Changing this creates a new route set.
    routes VpcRouterRoutesV2Route[]
    Static routes to add to the router.
    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 set.
    region str
    Pool where the route set is located, for example, ru-6. Learn more about available pools in Product availability by location. Changing this creates a new route set.
    router_id str
    Unique identifier of the router whose routes are managed. Retrieved from the selectelvpcrouter_v2 resource. Changing this creates a new route set.
    routes Sequence[VpcRouterRoutesV2RouteArgs]
    Static routes to add to the router.
    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 route set.
    region String
    Pool where the route set is located, for example, ru-6. Learn more about available pools in Product availability by location. Changing this creates a new route set.
    routerId String
    Unique identifier of the router whose routes are managed. Retrieved from the selectelvpcrouter_v2 resource. Changing this creates a new route set.
    routes List<Property Map>
    Static routes to add to the router.

    Supporting Types

    VpcRouterRoutesV2Route, VpcRouterRoutesV2RouteArgs

    DestinationCidr string
    Destination CIDR of the route, for example, 10.0.0.0/8.
    NextHop string
    IP address of the next hop gateway, 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.
    DestinationCidr string
    Destination CIDR of the route, for example, 10.0.0.0/8.
    NextHop string
    IP address of the next hop gateway, 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.
    destination_cidr string
    Destination CIDR of the route, for example, 10.0.0.0/8.
    next_hop string
    IP address of the next hop gateway, 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.
    destinationCidr String
    Destination CIDR of the route, for example, 10.0.0.0/8.
    nextHop String
    IP address of the next hop gateway, 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.
    destinationCidr string
    Destination CIDR of the route, for example, 10.0.0.0/8.
    nextHop string
    IP address of the next hop gateway, 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.
    destination_cidr str
    Destination CIDR of the route, for example, 10.0.0.0/8.
    next_hop str
    IP address of the next hop gateway, 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.
    destinationCidr String
    Destination CIDR of the route, for example, 10.0.0.0/8.
    nextHop String
    IP address of the next hop gateway, 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.

    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/vpcRouterRoutesV2:VpcRouterRoutesV2 routes_1 <id>
    

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

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

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

    Package Details

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

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial