1. Packages
  2. Scaleway
  3. API Docs
  4. VpcRoute
Scaleway v1.26.0 published on Friday, Mar 28, 2025 by pulumiverse

scaleway.VpcRoute

Explore with Pulumi AI

Deprecated: scaleway.index/vpcroute.VpcRoute has been deprecated in favor of scaleway.network/route.Route

Creates and manages Scaleway VPC Routes. For more information, see the main documentation.

Example Usage

Basic

import * as pulumi from "@pulumi/pulumi";
import * as scaleway from "@pulumiverse/scaleway";

const vpc01 = new scaleway.network.Vpc("vpc01", {name: "tf-vpc-vpn"});
const pn01 = new scaleway.network.PrivateNetwork("pn01", {
    name: "tf-pn-vpn",
    ipv4Subnet: {
        subnet: "172.16.64.0/22",
    },
    vpcId: vpc01.id,
});
const server01 = new scaleway.instance.Server("server01", {
    name: "tf-server-vpn",
    type: "PLAY2-MICRO",
    image: "openvpn",
});
const pnic01 = new scaleway.instance.PrivateNic("pnic01", {
    privateNetworkId: pn01.id,
    serverId: server01.id,
});
const rt01 = new scaleway.network.Route("rt01", {
    vpcId: vpc01.id,
    description: "tf-route-vpn",
    tags: [
        "tf",
        "route",
    ],
    destination: "10.0.0.0/24",
    nexthopResourceId: pnic01.id,
});
Copy
import pulumi
import pulumiverse_scaleway as scaleway

vpc01 = scaleway.network.Vpc("vpc01", name="tf-vpc-vpn")
pn01 = scaleway.network.PrivateNetwork("pn01",
    name="tf-pn-vpn",
    ipv4_subnet={
        "subnet": "172.16.64.0/22",
    },
    vpc_id=vpc01.id)
server01 = scaleway.instance.Server("server01",
    name="tf-server-vpn",
    type="PLAY2-MICRO",
    image="openvpn")
pnic01 = scaleway.instance.PrivateNic("pnic01",
    private_network_id=pn01.id,
    server_id=server01.id)
rt01 = scaleway.network.Route("rt01",
    vpc_id=vpc01.id,
    description="tf-route-vpn",
    tags=[
        "tf",
        "route",
    ],
    destination="10.0.0.0/24",
    nexthop_resource_id=pnic01.id)
Copy
package main

import (
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
	"github.com/pulumiverse/pulumi-scaleway/sdk/go/scaleway/instance"
	"github.com/pulumiverse/pulumi-scaleway/sdk/go/scaleway/network"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		vpc01, err := network.NewVpc(ctx, "vpc01", &network.VpcArgs{
			Name: pulumi.String("tf-vpc-vpn"),
		})
		if err != nil {
			return err
		}
		pn01, err := network.NewPrivateNetwork(ctx, "pn01", &network.PrivateNetworkArgs{
			Name: pulumi.String("tf-pn-vpn"),
			Ipv4Subnet: &network.PrivateNetworkIpv4SubnetArgs{
				Subnet: pulumi.String("172.16.64.0/22"),
			},
			VpcId: vpc01.ID(),
		})
		if err != nil {
			return err
		}
		server01, err := instance.NewServer(ctx, "server01", &instance.ServerArgs{
			Name:  pulumi.String("tf-server-vpn"),
			Type:  pulumi.String("PLAY2-MICRO"),
			Image: pulumi.String("openvpn"),
		})
		if err != nil {
			return err
		}
		pnic01, err := instance.NewPrivateNic(ctx, "pnic01", &instance.PrivateNicArgs{
			PrivateNetworkId: pn01.ID(),
			ServerId:         server01.ID(),
		})
		if err != nil {
			return err
		}
		_, err = network.NewRoute(ctx, "rt01", &network.RouteArgs{
			VpcId:       vpc01.ID(),
			Description: pulumi.String("tf-route-vpn"),
			Tags: pulumi.StringArray{
				pulumi.String("tf"),
				pulumi.String("route"),
			},
			Destination:       pulumi.String("10.0.0.0/24"),
			NexthopResourceId: pnic01.ID(),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Scaleway = Pulumiverse.Scaleway;

return await Deployment.RunAsync(() => 
{
    var vpc01 = new Scaleway.Network.Vpc("vpc01", new()
    {
        Name = "tf-vpc-vpn",
    });

    var pn01 = new Scaleway.Network.PrivateNetwork("pn01", new()
    {
        Name = "tf-pn-vpn",
        Ipv4Subnet = new Scaleway.Network.Inputs.PrivateNetworkIpv4SubnetArgs
        {
            Subnet = "172.16.64.0/22",
        },
        VpcId = vpc01.Id,
    });

    var server01 = new Scaleway.Instance.Server("server01", new()
    {
        Name = "tf-server-vpn",
        Type = "PLAY2-MICRO",
        Image = "openvpn",
    });

    var pnic01 = new Scaleway.Instance.PrivateNic("pnic01", new()
    {
        PrivateNetworkId = pn01.Id,
        ServerId = server01.Id,
    });

    var rt01 = new Scaleway.Network.Route("rt01", new()
    {
        VpcId = vpc01.Id,
        Description = "tf-route-vpn",
        Tags = new[]
        {
            "tf",
            "route",
        },
        Destination = "10.0.0.0/24",
        NexthopResourceId = pnic01.Id,
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.scaleway.network.Vpc;
import com.pulumi.scaleway.network.VpcArgs;
import com.pulumi.scaleway.network.PrivateNetwork;
import com.pulumi.scaleway.network.PrivateNetworkArgs;
import com.pulumi.scaleway.network.inputs.PrivateNetworkIpv4SubnetArgs;
import com.pulumi.scaleway.instance.Server;
import com.pulumi.scaleway.instance.ServerArgs;
import com.pulumi.scaleway.instance.PrivateNic;
import com.pulumi.scaleway.instance.PrivateNicArgs;
import com.pulumi.scaleway.network.Route;
import com.pulumi.scaleway.network.RouteArgs;
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 vpc01 = new Vpc("vpc01", VpcArgs.builder()
            .name("tf-vpc-vpn")
            .build());

        var pn01 = new PrivateNetwork("pn01", PrivateNetworkArgs.builder()
            .name("tf-pn-vpn")
            .ipv4Subnet(PrivateNetworkIpv4SubnetArgs.builder()
                .subnet("172.16.64.0/22")
                .build())
            .vpcId(vpc01.id())
            .build());

        var server01 = new Server("server01", ServerArgs.builder()
            .name("tf-server-vpn")
            .type("PLAY2-MICRO")
            .image("openvpn")
            .build());

        var pnic01 = new PrivateNic("pnic01", PrivateNicArgs.builder()
            .privateNetworkId(pn01.id())
            .serverId(server01.id())
            .build());

        var rt01 = new Route("rt01", RouteArgs.builder()
            .vpcId(vpc01.id())
            .description("tf-route-vpn")
            .tags(            
                "tf",
                "route")
            .destination("10.0.0.0/24")
            .nexthopResourceId(pnic01.id())
            .build());

    }
}
Copy
resources:
  vpc01:
    type: scaleway:network:Vpc
    properties:
      name: tf-vpc-vpn
  pn01:
    type: scaleway:network:PrivateNetwork
    properties:
      name: tf-pn-vpn
      ipv4Subnet:
        subnet: 172.16.64.0/22
      vpcId: ${vpc01.id}
  server01:
    type: scaleway:instance:Server
    properties:
      name: tf-server-vpn
      type: PLAY2-MICRO
      image: openvpn
  pnic01:
    type: scaleway:instance:PrivateNic
    properties:
      privateNetworkId: ${pn01.id}
      serverId: ${server01.id}
  rt01:
    type: scaleway:network:Route
    properties:
      vpcId: ${vpc01.id}
      description: tf-route-vpn
      tags:
        - tf
        - route
      destination: 10.0.0.0/24
      nexthopResourceId: ${pnic01.id}
Copy

Create VpcRoute Resource

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

Constructor syntax

new VpcRoute(name: string, args: VpcRouteArgs, opts?: CustomResourceOptions);
@overload
def VpcRoute(resource_name: str,
             args: VpcRouteArgs,
             opts: Optional[ResourceOptions] = None)

@overload
def VpcRoute(resource_name: str,
             opts: Optional[ResourceOptions] = None,
             description: Optional[str] = None,
             destination: Optional[str] = None,
             nexthop_private_network_id: Optional[str] = None,
             nexthop_resource_id: Optional[str] = None,
             region: Optional[str] = None,
             tags: Optional[Sequence[str]] = None,
             vpc_id: Optional[str] = None)
func NewVpcRoute(ctx *Context, name string, args VpcRouteArgs, opts ...ResourceOption) (*VpcRoute, error)
public VpcRoute(string name, VpcRouteArgs args, CustomResourceOptions? opts = null)
public VpcRoute(String name, VpcRouteArgs args)
public VpcRoute(String name, VpcRouteArgs args, CustomResourceOptions options)
type: scaleway:VpcRoute
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

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

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

VpcId
This property is required.
Changes to this property will trigger replacement.
string
The VPC ID the route belongs to.
Description string
The route description.
Destination string
The destination of the route.
NexthopPrivateNetworkId string
The ID of the nexthop private network.
NexthopResourceId string
The ID of the nexthop resource.
Region Changes to this property will trigger replacement. string
region) The region of the route.
Tags List<string>
The tags to associate with the route.
VpcId
This property is required.
Changes to this property will trigger replacement.
string
The VPC ID the route belongs to.
Description string
The route description.
Destination string
The destination of the route.
NexthopPrivateNetworkId string
The ID of the nexthop private network.
NexthopResourceId string
The ID of the nexthop resource.
Region Changes to this property will trigger replacement. string
region) The region of the route.
Tags []string
The tags to associate with the route.
vpcId
This property is required.
Changes to this property will trigger replacement.
String
The VPC ID the route belongs to.
description String
The route description.
destination String
The destination of the route.
nexthopPrivateNetworkId String
The ID of the nexthop private network.
nexthopResourceId String
The ID of the nexthop resource.
region Changes to this property will trigger replacement. String
region) The region of the route.
tags List<String>
The tags to associate with the route.
vpcId
This property is required.
Changes to this property will trigger replacement.
string
The VPC ID the route belongs to.
description string
The route description.
destination string
The destination of the route.
nexthopPrivateNetworkId string
The ID of the nexthop private network.
nexthopResourceId string
The ID of the nexthop resource.
region Changes to this property will trigger replacement. string
region) The region of the route.
tags string[]
The tags to associate with the route.
vpc_id
This property is required.
Changes to this property will trigger replacement.
str
The VPC ID the route belongs to.
description str
The route description.
destination str
The destination of the route.
nexthop_private_network_id str
The ID of the nexthop private network.
nexthop_resource_id str
The ID of the nexthop resource.
region Changes to this property will trigger replacement. str
region) The region of the route.
tags Sequence[str]
The tags to associate with the route.
vpcId
This property is required.
Changes to this property will trigger replacement.
String
The VPC ID the route belongs to.
description String
The route description.
destination String
The destination of the route.
nexthopPrivateNetworkId String
The ID of the nexthop private network.
nexthopResourceId String
The ID of the nexthop resource.
region Changes to this property will trigger replacement. String
region) The region of the route.
tags List<String>
The tags to associate with the route.

Outputs

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

CreatedAt string
The date and time of the creation of the route (RFC 3339 format).
Id string
The provider-assigned unique ID for this managed resource.
UpdatedAt string
The date and time of the creation of the route (RFC 3339 format).
CreatedAt string
The date and time of the creation of the route (RFC 3339 format).
Id string
The provider-assigned unique ID for this managed resource.
UpdatedAt string
The date and time of the creation of the route (RFC 3339 format).
createdAt String
The date and time of the creation of the route (RFC 3339 format).
id String
The provider-assigned unique ID for this managed resource.
updatedAt String
The date and time of the creation of the route (RFC 3339 format).
createdAt string
The date and time of the creation of the route (RFC 3339 format).
id string
The provider-assigned unique ID for this managed resource.
updatedAt string
The date and time of the creation of the route (RFC 3339 format).
created_at str
The date and time of the creation of the route (RFC 3339 format).
id str
The provider-assigned unique ID for this managed resource.
updated_at str
The date and time of the creation of the route (RFC 3339 format).
createdAt String
The date and time of the creation of the route (RFC 3339 format).
id String
The provider-assigned unique ID for this managed resource.
updatedAt String
The date and time of the creation of the route (RFC 3339 format).

Look up Existing VpcRoute Resource

Get an existing VpcRoute 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?: VpcRouteState, opts?: CustomResourceOptions): VpcRoute
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        created_at: Optional[str] = None,
        description: Optional[str] = None,
        destination: Optional[str] = None,
        nexthop_private_network_id: Optional[str] = None,
        nexthop_resource_id: Optional[str] = None,
        region: Optional[str] = None,
        tags: Optional[Sequence[str]] = None,
        updated_at: Optional[str] = None,
        vpc_id: Optional[str] = None) -> VpcRoute
func GetVpcRoute(ctx *Context, name string, id IDInput, state *VpcRouteState, opts ...ResourceOption) (*VpcRoute, error)
public static VpcRoute Get(string name, Input<string> id, VpcRouteState? state, CustomResourceOptions? opts = null)
public static VpcRoute get(String name, Output<String> id, VpcRouteState state, CustomResourceOptions options)
resources:  _:    type: scaleway:VpcRoute    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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:
CreatedAt string
The date and time of the creation of the route (RFC 3339 format).
Description string
The route description.
Destination string
The destination of the route.
NexthopPrivateNetworkId string
The ID of the nexthop private network.
NexthopResourceId string
The ID of the nexthop resource.
Region Changes to this property will trigger replacement. string
region) The region of the route.
Tags List<string>
The tags to associate with the route.
UpdatedAt string
The date and time of the creation of the route (RFC 3339 format).
VpcId Changes to this property will trigger replacement. string
The VPC ID the route belongs to.
CreatedAt string
The date and time of the creation of the route (RFC 3339 format).
Description string
The route description.
Destination string
The destination of the route.
NexthopPrivateNetworkId string
The ID of the nexthop private network.
NexthopResourceId string
The ID of the nexthop resource.
Region Changes to this property will trigger replacement. string
region) The region of the route.
Tags []string
The tags to associate with the route.
UpdatedAt string
The date and time of the creation of the route (RFC 3339 format).
VpcId Changes to this property will trigger replacement. string
The VPC ID the route belongs to.
createdAt String
The date and time of the creation of the route (RFC 3339 format).
description String
The route description.
destination String
The destination of the route.
nexthopPrivateNetworkId String
The ID of the nexthop private network.
nexthopResourceId String
The ID of the nexthop resource.
region Changes to this property will trigger replacement. String
region) The region of the route.
tags List<String>
The tags to associate with the route.
updatedAt String
The date and time of the creation of the route (RFC 3339 format).
vpcId Changes to this property will trigger replacement. String
The VPC ID the route belongs to.
createdAt string
The date and time of the creation of the route (RFC 3339 format).
description string
The route description.
destination string
The destination of the route.
nexthopPrivateNetworkId string
The ID of the nexthop private network.
nexthopResourceId string
The ID of the nexthop resource.
region Changes to this property will trigger replacement. string
region) The region of the route.
tags string[]
The tags to associate with the route.
updatedAt string
The date and time of the creation of the route (RFC 3339 format).
vpcId Changes to this property will trigger replacement. string
The VPC ID the route belongs to.
created_at str
The date and time of the creation of the route (RFC 3339 format).
description str
The route description.
destination str
The destination of the route.
nexthop_private_network_id str
The ID of the nexthop private network.
nexthop_resource_id str
The ID of the nexthop resource.
region Changes to this property will trigger replacement. str
region) The region of the route.
tags Sequence[str]
The tags to associate with the route.
updated_at str
The date and time of the creation of the route (RFC 3339 format).
vpc_id Changes to this property will trigger replacement. str
The VPC ID the route belongs to.
createdAt String
The date and time of the creation of the route (RFC 3339 format).
description String
The route description.
destination String
The destination of the route.
nexthopPrivateNetworkId String
The ID of the nexthop private network.
nexthopResourceId String
The ID of the nexthop resource.
region Changes to this property will trigger replacement. String
region) The region of the route.
tags List<String>
The tags to associate with the route.
updatedAt String
The date and time of the creation of the route (RFC 3339 format).
vpcId Changes to this property will trigger replacement. String
The VPC ID the route belongs to.

Import

Routes can be imported using {region}/{id}, e.g.

bash

$ pulumi import scaleway:index/vpcRoute:VpcRoute main fr-par/11111111-1111-1111-1111-111111111111
Copy

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

Package Details

Repository
scaleway pulumiverse/pulumi-scaleway
License
Apache-2.0
Notes
This Pulumi package is based on the scaleway Terraform Provider.