scaleway.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.Vpc("vpc01", {
name: "my-vpc",
tags: [
"demo",
"terraform",
],
});
import pulumi
import pulumiverse_scaleway as scaleway
vpc01 = scaleway.Vpc("vpc01",
name="my-vpc",
tags=[
"demo",
"terraform",
])
package main
import (
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/pulumiverse/pulumi-scaleway/sdk/go/scaleway"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := scaleway.NewVpc(ctx, "vpc01", &scaleway.VpcArgs{
Name: pulumi.String("my-vpc"),
Tags: pulumi.StringArray{
pulumi.String("demo"),
pulumi.String("terraform"),
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Scaleway = Pulumiverse.Scaleway;
return await Deployment.RunAsync(() =>
{
var vpc01 = new Scaleway.Vpc("vpc01", new()
{
Name = "my-vpc",
Tags = new[]
{
"demo",
"terraform",
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.scaleway.Vpc;
import com.pulumi.scaleway.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());
}
}
resources:
vpc01:
type: scaleway:Vpc
properties:
name: my-vpc
tags:
- demo
- terraform
Enable routing
import * as pulumi from "@pulumi/pulumi";
import * as scaleway from "@pulumiverse/scaleway";
const vpc01 = new scaleway.Vpc("vpc01", {
name: "my-vpc",
tags: [
"demo",
"terraform",
"routing",
],
enableRouting: true,
});
import pulumi
import pulumiverse_scaleway as scaleway
vpc01 = scaleway.Vpc("vpc01",
name="my-vpc",
tags=[
"demo",
"terraform",
"routing",
],
enable_routing=True)
package main
import (
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/pulumiverse/pulumi-scaleway/sdk/go/scaleway"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := scaleway.NewVpc(ctx, "vpc01", &scaleway.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
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Scaleway = Pulumiverse.Scaleway;
return await Deployment.RunAsync(() =>
{
var vpc01 = new Scaleway.Vpc("vpc01", new()
{
Name = "my-vpc",
Tags = new[]
{
"demo",
"terraform",
"routing",
},
EnableRouting = true,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.scaleway.Vpc;
import com.pulumi.scaleway.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());
}
}
resources:
vpc01:
type: scaleway:Vpc
properties:
name: my-vpc
tags:
- demo
- terraform
- routing
enableRouting: true
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)
type: scaleway:Vpc
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name 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 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 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 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 String
- The unique name of the resource.
- args 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.Vpc("vpcResource", new()
{
EnableRouting = false,
Name = "string",
ProjectId = "string",
Region = "string",
Tags = new[]
{
"string",
},
});
example, err := scaleway.NewVpc(ctx, "vpcResource", &scaleway.VpcArgs{
EnableRouting: pulumi.Bool(false),
Name: pulumi.String("string"),
ProjectId: pulumi.String("string"),
Region: pulumi.String("string"),
Tags: pulumi.StringArray{
pulumi.String("string"),
},
})
var vpcResource = new Vpc("vpcResource", VpcArgs.builder()
.enableRouting(false)
.name("string")
.projectId("string")
.region("string")
.tags("string")
.build());
vpc_resource = scaleway.Vpc("vpcResource",
enable_routing=False,
name="string",
project_id="string",
region="string",
tags=["string"])
const vpcResource = new scaleway.Vpc("vpcResource", {
enableRouting: false,
name: "string",
projectId: "string",
region: "string",
tags: ["string"],
});
type: scaleway:Vpc
properties:
enableRouting: false
name: string
projectId: string
region: string
tags:
- string
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:
- Enable
Routing 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.
- Project
Id string project_id
) The ID of the Project the VPC is associated with.- Region string
region
) The region of the VPC.- List<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 string
- The name for the VPC. If not provided it will be randomly generated.
- Project
Id string project_id
) The ID of the Project the VPC is associated with.- Region string
region
) The region of the VPC.- []string
- The tags to associate with the VPC.
- enable
Routing 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.
- project
Id String project_id
) The ID of the Project the VPC is associated with.- region String
region
) The region of the VPC.- List<String>
- The tags to associate with the VPC.
- enable
Routing 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.
- project
Id string project_id
) The ID of the Project the VPC is associated with.- region string
region
) The region of the VPC.- 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 str project_id
) The ID of the Project the VPC is associated with.- region str
region
) The region of the VPC.- Sequence[str]
- The tags to associate with the VPC.
- enable
Routing 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.
- project
Id String project_id
) The ID of the Project the VPC is associated with.- region String
region
) The region of the VPC.- 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:
- Created
At string - Date and time of VPC's creation (RFC 3339 format).
- Id string
- 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 string - The Organization ID the VPC is associated with.
- Updated
At string - Date and time of VPC's last update (RFC 3339 format).
- Created
At string - Date and time of VPC's creation (RFC 3339 format).
- Id string
- 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 string - The Organization ID the VPC is associated with.
- Updated
At string - Date and time of VPC's last update (RFC 3339 format).
- created
At String - Date and time of VPC's creation (RFC 3339 format).
- id String
- The provider-assigned unique ID for this managed resource.
- is
Default Boolean - Defines whether the VPC is the default one for its Project.
- organization
Id String - The Organization ID the VPC is associated with.
- updated
At String - Date and time of VPC's last update (RFC 3339 format).
- created
At string - Date and time of VPC's creation (RFC 3339 format).
- id string
- The provider-assigned unique ID for this managed resource.
- is
Default boolean - Defines whether the VPC is the default one for its Project.
- organization
Id string - The Organization ID the VPC is associated with.
- updated
At 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).
- created
At String - Date and time of VPC's creation (RFC 3339 format).
- id String
- The provider-assigned unique ID for this managed resource.
- is
Default Boolean - Defines whether the VPC is the default one for its Project.
- organization
Id String - The Organization ID the VPC is associated with.
- updated
At 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)
Resource lookup is not supported in YAML
- 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.
- Created
At string - 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 string
- The name for the VPC. If not provided it will be randomly generated.
- Organization
Id string - The Organization ID the VPC is associated with.
- Project
Id string project_id
) The ID of the Project the VPC is associated with.- Region string
region
) The region of the VPC.- List<string>
- The tags to associate with the VPC.
- Updated
At string - Date and time of VPC's last update (RFC 3339 format).
- Created
At string - 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 string
- The name for the VPC. If not provided it will be randomly generated.
- Organization
Id string - The Organization ID the VPC is associated with.
- Project
Id string project_id
) The ID of the Project the VPC is associated with.- Region string
region
) The region of the VPC.- []string
- The tags to associate with the VPC.
- Updated
At string - Date and time of VPC's last update (RFC 3339 format).
- created
At String - Date and time of VPC's creation (RFC 3339 format).
- enable
Routing Boolean - Enable routing between Private Networks in the VPC. Note that you will not be able to deactivate it afterwards.
- is
Default 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.
- organization
Id String - The Organization ID the VPC is associated with.
- project
Id String project_id
) The ID of the Project the VPC is associated with.- region String
region
) The region of the VPC.- List<String>
- The tags to associate with the VPC.
- updated
At String - Date and time of VPC's last update (RFC 3339 format).
- created
At string - Date and time of VPC's creation (RFC 3339 format).
- enable
Routing boolean - Enable routing between Private Networks in the VPC. Note that you will not be able to deactivate it afterwards.
- is
Default 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.
- organization
Id string - The Organization ID the VPC is associated with.
- project
Id string project_id
) The ID of the Project the VPC is associated with.- region string
region
) The region of the VPC.- string[]
- The tags to associate with the VPC.
- updated
At 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 str project_id
) The ID of the Project the VPC is associated with.- region str
region
) The region of the VPC.- Sequence[str]
- The tags to associate with the VPC.
- updated_
at str - Date and time of VPC's last update (RFC 3339 format).
- created
At String - Date and time of VPC's creation (RFC 3339 format).
- enable
Routing Boolean - Enable routing between Private Networks in the VPC. Note that you will not be able to deactivate it afterwards.
- is
Default 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.
- organization
Id String - The Organization ID the VPC is associated with.
- project
Id String project_id
) The ID of the Project the VPC is associated with.- region String
region
) The region of the VPC.- List<String>
- The tags to associate with the VPC.
- updated
At 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:index/vpc:Vpc vpc_demo fr-par/11111111-1111-1111-1111-111111111111
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.