NetworkArgs

data class NetworkArgs(val cidrBlock: Output<String>? = null, val classicLinkEnabled: Output<Boolean>? = null, val description: Output<String>? = null, val dnsHostnameStatus: Output<String>? = null, val dryRun: Output<Boolean>? = null, val enableIpv6: Output<Boolean>? = null, val ipv4CidrMask: Output<Int>? = null, val ipv4IpamPoolId: Output<String>? = null, val ipv6CidrBlock: Output<String>? = null, val ipv6Isp: Output<String>? = null, val isDefault: Output<Boolean>? = null, val name: Output<String>? = null, val resourceGroupId: Output<String>? = null, val secondaryCidrBlocks: Output<List<String>>? = null, val secondaryCidrMask: Output<Int>? = null, val systemRouteTableDescription: Output<String>? = null, val systemRouteTableName: Output<String>? = null, val tags: Output<Map<String, String>>? = null, val userCidrs: Output<List<String>>? = null, val vpcName: Output<String>? = null) : ConvertibleToJava<NetworkArgs>

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>

Constructors

Link copied to clipboard
constructor(cidrBlock: Output<String>? = null, classicLinkEnabled: Output<Boolean>? = null, description: Output<String>? = null, dnsHostnameStatus: Output<String>? = null, dryRun: Output<Boolean>? = null, enableIpv6: Output<Boolean>? = null, ipv4CidrMask: Output<Int>? = null, ipv4IpamPoolId: Output<String>? = null, ipv6CidrBlock: Output<String>? = null, ipv6Isp: Output<String>? = null, isDefault: Output<Boolean>? = null, name: Output<String>? = null, resourceGroupId: Output<String>? = null, secondaryCidrBlocks: Output<List<String>>? = null, secondaryCidrMask: Output<Int>? = null, systemRouteTableDescription: Output<String>? = null, systemRouteTableName: Output<String>? = null, tags: Output<Map<String, String>>? = null, userCidrs: Output<List<String>>? = null, vpcName: Output<String>? = null)

Properties

Link copied to clipboard
val cidrBlock: Output<String>? = null

The CIDR block of the VPC.

Link copied to clipboard
val classicLinkEnabled: Output<Boolean>? = null

The status of ClassicLink function.

Link copied to clipboard
val description: Output<String>? = null

The new description of the VPC. The description must be 1 to 256 characters in length, and cannot start with http:// or https://.

Link copied to clipboard
val dnsHostnameStatus: Output<String>? = null

The status of VPC DNS Hostname. Valid values: ENABLED, DISABLED.

Link copied to clipboard
val dryRun: Output<Boolean>? = null

Specifies whether to perform a dry run. Valid values:

Link copied to clipboard
val enableIpv6: Output<Boolean>? = null

Specifies whether to enable IPv6. Valid values:

Link copied to clipboard
val ipv4CidrMask: Output<Int>? = null

Allocate VPC from The IPAM address pool by entering a mask.

Link copied to clipboard
val ipv4IpamPoolId: Output<String>? = null

The ID of the IP Address Manager (IPAM) pool that contains IPv4 addresses.

Link copied to clipboard
val ipv6CidrBlock: Output<String>? = null

The IPv6 CIDR block of the default VPC.

Link copied to clipboard
val ipv6Isp: Output<String>? = null

The IPv6 address segment type of the VPC. Value:

Link copied to clipboard
val isDefault: Output<Boolean>? = null

Specifies whether to create the default VPC in the specified region. Valid values:

Link copied to clipboard
val name: Output<String>? = null

. Field 'name' has been deprecated from provider version 1.119.0. New field 'vpc_name' instead.

Link copied to clipboard
val resourceGroupId: Output<String>? = null

The ID of the resource group to which you want to move the resource.

Link copied to clipboard
val secondaryCidrBlocks: Output<List<String>>? = null

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.

Link copied to clipboard
val secondaryCidrMask: Output<Int>? = null

Add an additional CIDR block from the IPAM address pool to the VPC by entering a mask.

Link copied to clipboard
val systemRouteTableDescription: Output<String>? = null

The description of the route table. The description must be 1 to 256 characters in length, and cannot start with http:// or https://.

Link copied to clipboard
val systemRouteTableName: Output<String>? = null

The name of the route table. The name must be 1 to 128 characters in length and cannot start with http:// or https://.

Link copied to clipboard
val tags: Output<Map<String, String>>? = null

The tags of Vpc.

Link copied to clipboard
val userCidrs: Output<List<String>>? = null

A list of user CIDRs.

Link copied to clipboard
val vpcName: Output<String>? = null

The new name of the VPC. The name must be 1 to 128 characters in length and cannot start with http:// or https://. The following arguments will be discarded. Please use new fields as soon as possible:

Functions

Link copied to clipboard
open override fun toJava(): NetworkArgs