Network
Provides a Vpc Vpc resource. A VPC instance creates a VPC. You can fully control your own VPC, such as selecting IP address ranges, configuring routing tables, and gateways. You can use Alibaba cloud resources such as cloud servers, apsaradb for RDS, and load balancer in your own VPC.
NOTE: Available since v1.0.0. NOTE: This resource will auto build a router and a route table while it uses
alicloud.vpc.Networkto build a vpc resource. NOTE: Currently, the IPv4 / IPv6 dual-stack VPC function is under public testing. Only the following regions support IPv4 / IPv6 dual-stack VPC:cn-hangzhou,cn-shanghai,cn-shenzhen,cn-beijing,cn-huhehaote,cn-hongkongandap-southeast-1, and need to apply for public beta qualification. To use, please submit an application.
Module Support
You can use the existing vpc module to create a VPC and several VSwitches one-click. For information about Vpc Vpc and how to use it, see What is Vpc.
Example Usage
Basic Usage
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const config = new pulumi.Config();
const name = config.get("name") || "terraform-example";
const _default = new alicloud.vpc.Network("default", {
ipv6Isp: "BGP",
description: "test",
cidrBlock: "10.0.0.0/8",
vpcName: name,
enableIpv6: true,
});import pulumi
import pulumi_alicloud as alicloud
config = pulumi.Config()
name = config.get("name")
if name is None:
name = "terraform-example"
default = alicloud.vpc.Network("default",
ipv6_isp="BGP",
description="test",
cidr_block="10.0.0.0/8",
vpc_name=name,
enable_ipv6=True)using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() =>
{
var config = new Config();
var name = config.Get("name") ?? "terraform-example";
var @default = new AliCloud.Vpc.Network("default", new()
{
Ipv6Isp = "BGP",
Description = "test",
CidrBlock = "10.0.0.0/8",
VpcName = name,
EnableIpv6 = true,
});
});package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/vpc"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
cfg := config.New(ctx, "")
name := "terraform-example"
if param := cfg.Get("name"); param != "" {
name = param
}
_, err := vpc.NewNetwork(ctx, "default", &vpc.NetworkArgs{
Ipv6Isp: pulumi.String("BGP"),
Description: pulumi.String("test"),
CidrBlock: pulumi.String("10.0.0.0/8"),
VpcName: pulumi.String(name),
EnableIpv6: pulumi.Bool(true),
})
if err != nil {
return err
}
return nil
})
}package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.vpc.Network;
import com.pulumi.alicloud.vpc.NetworkArgs;
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) {
final var config = ctx.config();
final var name = config.get("name").orElse("terraform-example");
var default_ = new Network("default", NetworkArgs.builder()
.ipv6Isp("BGP")
.description("test")
.cidrBlock("10.0.0.0/8")
.vpcName(name)
.enableIpv6(true)
.build());
}
}configuration:
name:
type: string
default: terraform-example
resources:
default:
type: alicloud:vpc:Network
properties:
ipv6Isp: BGP
description: test
cidrBlock: 10.0.0.0/8
vpcName: ${name}
enableIpv6: trueImport
Vpc Vpc can be imported using the id, e.g.
$ pulumi import alicloud:vpc/network:Network example <id>Properties
The status of ClassicLink function.
The creation time of the VPC.
The VPC description. Defaults to null.
Whether to enable the IPv6 network segment. Value:
The IPv6 CIDR block of the VPC.
The IPv6 CIDR block information of the VPC.
The ID of the resource group to which the VPC belongs.
Field 'router_table_id' has been deprecated from provider version 1.206.0. New field 'route_table_id' instead.
The route table ID of the router created by default on VPC creation.
Field 'secondary_cidr_blocks' has been deprecated from provider version 1.185.0 and it will be removed in the future version. Please use the new resource 'alicloud_vpc_ipv4_cidr_block'. secondary_cidr_blocks attributes and alicloud.vpc.Ipv4CidrBlock resource cannot be used at the same time.