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: This resource will auto build a router and a route table while it uses
alicloud.vpc.Network
to build a vpc resource. NOTE: Available since v1.0.0.
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: true
Import
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 new description of the VPC. The description must be 1 to 256 characters in length, and cannot start with http://
or https://
.
The status of VPC DNS Hostname
Whether to enable the IPv6 network segment. Value:
Force delete vpc or not.
Allocate VPC from The IPAM address pool by entering a mask.
The ID of the IP Address Manager (IPAM) pool that contains IPv4 addresses.
The IPv6 CIDR block of the default VPC.
The IPv6 CIDR block information of the VPC.
The ID of the resource group to which you want to move the resource.
. Field 'router_table_id' has been deprecated from provider version 1.227.1. New field 'route_table_id' instead.
The ID of the system route table.
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.
Field 'router_table_id' has been deprecated from provider version 1.248.0. New resource 'alicloud_vpc_ipv4_cidr_block' instead.
The description of the route table. The description must be 1 to 256 characters in length, and cannot start with http://
or https://
.
The name of the route table. The name must be 1 to 128 characters in length and cannot start with http://
or https://
.
Whether the system route table receives propagation routes.