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

scaleway.network.Vpc

Explore with Pulumi AI

Creates and manages Scaleway Virtual Private Clouds. 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: "my-vpc",
    tags: [
        "demo",
        "terraform",
    ],
});
Copy
import pulumi
import pulumiverse_scaleway as scaleway

vpc01 = scaleway.network.Vpc("vpc01",
    name="my-vpc",
    tags=[
        "demo",
        "terraform",
    ])
Copy
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := network.NewVpc(ctx, "vpc01", &network.VpcArgs{
			Name: pulumi.String("my-vpc"),
			Tags: pulumi.StringArray{
				pulumi.String("demo"),
				pulumi.String("terraform"),
			},
		})
		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 = "my-vpc",
        Tags = new[]
        {
            "demo",
            "terraform",
        },
    });

});
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 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("my-vpc")
            .tags(            
                "demo",
                "terraform")
            .build());

    }
}
Copy
resources:
  vpc01:
    type: scaleway:network:Vpc
    properties:
      name: my-vpc
      tags:
        - demo
        - terraform
Copy

Enable routing

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

const vpc01 = new scaleway.network.Vpc("vpc01", {
    name: "my-vpc",
    tags: [
        "demo",
        "terraform",
        "routing",
    ],
    enableRouting: true,
});
Copy
import pulumi
import pulumiverse_scaleway as scaleway

vpc01 = scaleway.network.Vpc("vpc01",
    name="my-vpc",
    tags=[
        "demo",
        "terraform",
        "routing",
    ],
    enable_routing=True)
Copy
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := network.NewVpc(ctx, "vpc01", &network.VpcArgs{
			Name: pulumi.String("my-vpc"),
			Tags: pulumi.StringArray{
				pulumi.String("demo"),
				pulumi.String("terraform"),
				pulumi.String("routing"),
			},
			EnableRouting: pulumi.Bool(true),
		})
		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 = "my-vpc",
        Tags = new[]
        {
            "demo",
            "terraform",
            "routing",
        },
        EnableRouting = true,
    });

});
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 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("my-vpc")
            .tags(            
                "demo",
                "terraform",
                "routing")
            .enableRouting(true)
            .build());

    }
}
Copy
resources:
  vpc01:
    type: scaleway:network:Vpc
    properties:
      name: my-vpc
      tags:
        - demo
        - terraform
        - routing
      enableRouting: true
Copy

Create Vpc Resource

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

Constructor syntax

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

@overload
def Vpc(resource_name: str,
        opts: Optional[ResourceOptions] = None,
        enable_routing: Optional[bool] = None,
        name: Optional[str] = None,
        project_id: Optional[str] = None,
        region: Optional[str] = None,
        tags: Optional[Sequence[str]] = None)
func NewVpc(ctx *Context, name string, args *VpcArgs, opts ...ResourceOption) (*Vpc, error)
public Vpc(string name, VpcArgs? args = null, CustomResourceOptions? opts = null)
public Vpc(String name, VpcArgs args)
public Vpc(String name, VpcArgs args, CustomResourceOptions options)
type: scaleway:network:Vpc
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 VpcArgs
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 VpcArgs
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 VpcArgs
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 VpcArgs
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. VpcArgs
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 vpcResource = new Scaleway.Network.Vpc("vpcResource", new()
{
    EnableRouting = false,
    Name = "string",
    ProjectId = "string",
    Region = "string",
    Tags = new[]
    {
        "string",
    },
});
Copy
example, err := network.NewVpc(ctx, "vpcResource", &network.VpcArgs{
	EnableRouting: pulumi.Bool(false),
	Name:          pulumi.String("string"),
	ProjectId:     pulumi.String("string"),
	Region:        pulumi.String("string"),
	Tags: pulumi.StringArray{
		pulumi.String("string"),
	},
})
Copy
var vpcResource = new Vpc("vpcResource", VpcArgs.builder()
    .enableRouting(false)
    .name("string")
    .projectId("string")
    .region("string")
    .tags("string")
    .build());
Copy
vpc_resource = scaleway.network.Vpc("vpcResource",
    enable_routing=False,
    name="string",
    project_id="string",
    region="string",
    tags=["string"])
Copy
const vpcResource = new scaleway.network.Vpc("vpcResource", {
    enableRouting: false,
    name: "string",
    projectId: "string",
    region: "string",
    tags: ["string"],
});
Copy
type: scaleway:network:Vpc
properties:
    enableRouting: false
    name: string
    projectId: string
    region: string
    tags:
        - string
Copy

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

EnableRouting bool
Enable routing between Private Networks in the VPC. Note that you will not be able to deactivate it afterwards.
Name string
The name for the VPC. If not provided it will be randomly generated.
ProjectId Changes to this property will trigger replacement. string
project_id) The ID of the Project the VPC is associated with.
Region Changes to this property will trigger replacement. string
region) The region of the VPC.
Tags List<string>
The tags to associate with the VPC.
EnableRouting bool
Enable routing between Private Networks in the VPC. Note that you will not be able to deactivate it afterwards.
Name string
The name for the VPC. If not provided it will be randomly generated.
ProjectId Changes to this property will trigger replacement. string
project_id) The ID of the Project the VPC is associated with.
Region Changes to this property will trigger replacement. string
region) The region of the VPC.
Tags []string
The tags to associate with the VPC.
enableRouting Boolean
Enable routing between Private Networks in the VPC. Note that you will not be able to deactivate it afterwards.
name String
The name for the VPC. If not provided it will be randomly generated.
projectId Changes to this property will trigger replacement. String
project_id) The ID of the Project the VPC is associated with.
region Changes to this property will trigger replacement. String
region) The region of the VPC.
tags List<String>
The tags to associate with the VPC.
enableRouting boolean
Enable routing between Private Networks in the VPC. Note that you will not be able to deactivate it afterwards.
name string
The name for the VPC. If not provided it will be randomly generated.
projectId Changes to this property will trigger replacement. string
project_id) The ID of the Project the VPC is associated with.
region Changes to this property will trigger replacement. string
region) The region of the VPC.
tags string[]
The tags to associate with the VPC.
enable_routing bool
Enable routing between Private Networks in the VPC. Note that you will not be able to deactivate it afterwards.
name str
The name for the VPC. If not provided it will be randomly generated.
project_id Changes to this property will trigger replacement. str
project_id) The ID of the Project the VPC is associated with.
region Changes to this property will trigger replacement. str
region) The region of the VPC.
tags Sequence[str]
The tags to associate with the VPC.
enableRouting Boolean
Enable routing between Private Networks in the VPC. Note that you will not be able to deactivate it afterwards.
name String
The name for the VPC. If not provided it will be randomly generated.
projectId Changes to this property will trigger replacement. String
project_id) The ID of the Project the VPC is associated with.
region Changes to this property will trigger replacement. String
region) The region of the VPC.
tags List<String>
The tags to associate with the VPC.

Outputs

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

CreatedAt string
Date and time of VPC's creation (RFC 3339 format).
Id string
The provider-assigned unique ID for this managed resource.
IsDefault bool
Defines whether the VPC is the default one for its Project.
OrganizationId string
The Organization ID the VPC is associated with.
UpdatedAt string
Date and time of VPC's last update (RFC 3339 format).
CreatedAt string
Date and time of VPC's creation (RFC 3339 format).
Id string
The provider-assigned unique ID for this managed resource.
IsDefault bool
Defines whether the VPC is the default one for its Project.
OrganizationId string
The Organization ID the VPC is associated with.
UpdatedAt string
Date and time of VPC's last update (RFC 3339 format).
createdAt String
Date and time of VPC's creation (RFC 3339 format).
id String
The provider-assigned unique ID for this managed resource.
isDefault Boolean
Defines whether the VPC is the default one for its Project.
organizationId String
The Organization ID the VPC is associated with.
updatedAt String
Date and time of VPC's last update (RFC 3339 format).
createdAt string
Date and time of VPC's creation (RFC 3339 format).
id string
The provider-assigned unique ID for this managed resource.
isDefault boolean
Defines whether the VPC is the default one for its Project.
organizationId string
The Organization ID the VPC is associated with.
updatedAt string
Date and time of VPC's last update (RFC 3339 format).
created_at str
Date and time of VPC's creation (RFC 3339 format).
id str
The provider-assigned unique ID for this managed resource.
is_default bool
Defines whether the VPC is the default one for its Project.
organization_id str
The Organization ID the VPC is associated with.
updated_at str
Date and time of VPC's last update (RFC 3339 format).
createdAt String
Date and time of VPC's creation (RFC 3339 format).
id String
The provider-assigned unique ID for this managed resource.
isDefault Boolean
Defines whether the VPC is the default one for its Project.
organizationId String
The Organization ID the VPC is associated with.
updatedAt String
Date and time of VPC's last update (RFC 3339 format).

Look up Existing Vpc Resource

Get an existing Vpc 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?: VpcState, opts?: CustomResourceOptions): Vpc
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        created_at: Optional[str] = None,
        enable_routing: Optional[bool] = None,
        is_default: Optional[bool] = None,
        name: Optional[str] = None,
        organization_id: Optional[str] = None,
        project_id: Optional[str] = None,
        region: Optional[str] = None,
        tags: Optional[Sequence[str]] = None,
        updated_at: Optional[str] = None) -> Vpc
func GetVpc(ctx *Context, name string, id IDInput, state *VpcState, opts ...ResourceOption) (*Vpc, error)
public static Vpc Get(string name, Input<string> id, VpcState? state, CustomResourceOptions? opts = null)
public static Vpc get(String name, Output<String> id, VpcState state, CustomResourceOptions options)
resources:  _:    type: scaleway:network:Vpc    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
Date and time of VPC's creation (RFC 3339 format).
EnableRouting bool
Enable routing between Private Networks in the VPC. Note that you will not be able to deactivate it afterwards.
IsDefault bool
Defines whether the VPC is the default one for its Project.
Name string
The name for the VPC. If not provided it will be randomly generated.
OrganizationId string
The Organization ID the VPC is associated with.
ProjectId Changes to this property will trigger replacement. string
project_id) The ID of the Project the VPC is associated with.
Region Changes to this property will trigger replacement. string
region) The region of the VPC.
Tags List<string>
The tags to associate with the VPC.
UpdatedAt string
Date and time of VPC's last update (RFC 3339 format).
CreatedAt string
Date and time of VPC's creation (RFC 3339 format).
EnableRouting bool
Enable routing between Private Networks in the VPC. Note that you will not be able to deactivate it afterwards.
IsDefault bool
Defines whether the VPC is the default one for its Project.
Name string
The name for the VPC. If not provided it will be randomly generated.
OrganizationId string
The Organization ID the VPC is associated with.
ProjectId Changes to this property will trigger replacement. string
project_id) The ID of the Project the VPC is associated with.
Region Changes to this property will trigger replacement. string
region) The region of the VPC.
Tags []string
The tags to associate with the VPC.
UpdatedAt string
Date and time of VPC's last update (RFC 3339 format).
createdAt String
Date and time of VPC's creation (RFC 3339 format).
enableRouting Boolean
Enable routing between Private Networks in the VPC. Note that you will not be able to deactivate it afterwards.
isDefault Boolean
Defines whether the VPC is the default one for its Project.
name String
The name for the VPC. If not provided it will be randomly generated.
organizationId String
The Organization ID the VPC is associated with.
projectId Changes to this property will trigger replacement. String
project_id) The ID of the Project the VPC is associated with.
region Changes to this property will trigger replacement. String
region) The region of the VPC.
tags List<String>
The tags to associate with the VPC.
updatedAt String
Date and time of VPC's last update (RFC 3339 format).
createdAt string
Date and time of VPC's creation (RFC 3339 format).
enableRouting boolean
Enable routing between Private Networks in the VPC. Note that you will not be able to deactivate it afterwards.
isDefault boolean
Defines whether the VPC is the default one for its Project.
name string
The name for the VPC. If not provided it will be randomly generated.
organizationId string
The Organization ID the VPC is associated with.
projectId Changes to this property will trigger replacement. string
project_id) The ID of the Project the VPC is associated with.
region Changes to this property will trigger replacement. string
region) The region of the VPC.
tags string[]
The tags to associate with the VPC.
updatedAt string
Date and time of VPC's last update (RFC 3339 format).
created_at str
Date and time of VPC's creation (RFC 3339 format).
enable_routing bool
Enable routing between Private Networks in the VPC. Note that you will not be able to deactivate it afterwards.
is_default bool
Defines whether the VPC is the default one for its Project.
name str
The name for the VPC. If not provided it will be randomly generated.
organization_id str
The Organization ID the VPC is associated with.
project_id Changes to this property will trigger replacement. str
project_id) The ID of the Project the VPC is associated with.
region Changes to this property will trigger replacement. str
region) The region of the VPC.
tags Sequence[str]
The tags to associate with the VPC.
updated_at str
Date and time of VPC's last update (RFC 3339 format).
createdAt String
Date and time of VPC's creation (RFC 3339 format).
enableRouting Boolean
Enable routing between Private Networks in the VPC. Note that you will not be able to deactivate it afterwards.
isDefault Boolean
Defines whether the VPC is the default one for its Project.
name String
The name for the VPC. If not provided it will be randomly generated.
organizationId String
The Organization ID the VPC is associated with.
projectId Changes to this property will trigger replacement. String
project_id) The ID of the Project the VPC is associated with.
region Changes to this property will trigger replacement. String
region) The region of the VPC.
tags List<String>
The tags to associate with the VPC.
updatedAt String
Date and time of VPC's last update (RFC 3339 format).

Import

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

bash

$ pulumi import scaleway:network/vpc:Vpc vpc_demo 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.