1. Packages
  2. Scaleway
  3. API Docs
  4. Vpc
Scaleway v1.15.0 published on Tuesday, Jul 30, 2024 by pulumiverse

scaleway.Vpc

Explore with Pulumi AI

scaleway logo
Scaleway v1.15.0 published on Tuesday, Jul 30, 2024 by pulumiverse

    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", {tags: [
        "demo",
        "terraform",
    ]});
    
    import pulumi
    import pulumiverse_scaleway as scaleway
    
    vpc01 = scaleway.Vpc("vpc01", 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{
    			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()
        {
            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()
                .tags(            
                    "demo",
                    "terraform")
                .build());
    
        }
    }
    
    resources:
      vpc01:
        type: scaleway:Vpc
        properties:
          tags:
            - demo
            - terraform
    

    Enable routing

    import * as pulumi from "@pulumi/pulumi";
    import * as scaleway from "@pulumiverse/scaleway";
    
    const vpc01 = new scaleway.Vpc("vpc01", {
        enableRouting: true,
        tags: [
            "demo",
            "terraform",
            "routing",
        ],
    });
    
    import pulumi
    import pulumiverse_scaleway as scaleway
    
    vpc01 = scaleway.Vpc("vpc01",
        enable_routing=True,
        tags=[
            "demo",
            "terraform",
            "routing",
        ])
    
    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{
    			EnableRouting: pulumi.Bool(true),
    			Tags: pulumi.StringArray{
    				pulumi.String("demo"),
    				pulumi.String("terraform"),
    				pulumi.String("routing"),
    			},
    		})
    		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()
        {
            EnableRouting = true,
            Tags = new[]
            {
                "demo",
                "terraform",
                "routing",
            },
        });
    
    });
    
    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()
                .enableRouting(true)
                .tags(            
                    "demo",
                    "terraform",
                    "routing")
                .build());
    
        }
    }
    
    resources:
      vpc01:
        type: scaleway:Vpc
        properties:
          enableRouting: true
          tags:
            - demo
            - terraform
            - routing
    

    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: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

    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 string
    project_id) The ID of the Project the VPC is associated with.
    Region 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 string
    project_id) The ID of the Project the VPC is associated with.
    Region 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 String
    project_id) The ID of the Project the VPC is associated with.
    region 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 string
    project_id) The ID of the Project the VPC is associated with.
    region 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 str
    project_id) The ID of the Project the VPC is associated with.
    region 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 String
    project_id) The ID of the Project the VPC is associated with.
    region 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)
    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.
    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 string
    project_id) The ID of the Project the VPC is associated with.
    Region 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 string
    project_id) The ID of the Project the VPC is associated with.
    Region 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 String
    project_id) The ID of the Project the VPC is associated with.
    region 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 string
    project_id) The ID of the Project the VPC is associated with.
    region 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 str
    project_id) The ID of the Project the VPC is associated with.
    region 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 String
    project_id) The ID of the Project the VPC is associated with.
    region 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: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.
    scaleway logo
    Scaleway v1.15.0 published on Tuesday, Jul 30, 2024 by pulumiverse