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.
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.
Basic Usage
variable "name" {
default = "terraform-example"
}
resource "alicloud_vpc" "default" {
ipv6_isp = "BGP"
description = "test"
cidr_block = "10.0.0.0/8"
vpc_name = var.name
enable_ipv6 = true
}
The following arguments are supported:
cidr_block
- (Optional, Computed) The CIDR block for the VPC. The cidr_block
is Optional and default value is 172.16.0.0/12
after v1.119.0+.classic_link_enabled
- (Optional) The status of ClassicLink function.description
- (Optional) The VPC description. Defaults to null.dry_run
- (Optional, Available since v1.119.0) Whether to PreCheck only this request. Value:
enable_ipv6
- (Optional, Available since v1.119.0) Whether to enable the IPv6 network segment. Value:
ipv6_isp
- (Optional) The IPv6 address segment type of the VPC. Value:
The following arguments will be discarded. Please use new fields as soon as possible:
name
- (Deprecated since v1.119.0). Field 'name' has been deprecated from provider version 1.119.0. New field 'vpc_name' instead.router_table_id
- (Deprecated since v1.206.0+) Field 'router_table_id' has been deprecated from provider version 1.206.0. New field 'route_table_id' instead.The following attributes are exported:
id
- The ID of the resource supplied above.create_time
- The creation time of the VPC.ipv6_cidr_block
- The ipv6 cidr block of vpc.ipv6_cidr_blocks
- The IPv6 CIDR block information of the VPC.
ipv6_cidr_block
- The IPv6 CIDR block of the VPC.ipv6_isp
- Valid values: BGP (default): Alibaba Cloud BGP IPv6.route_table_id
- The route table ID of the router created by default on VPC creation.router_id
- The ID of the router created by default on VPC creation.status
- The status of the VPC. Pending: The VPC is being configured. Available: The VPC is available.The timeouts
block allows you to specify timeouts for certain actions:
create
- (Defaults to 5 mins) Used when create the Vpc.delete
- (Defaults to 5 mins) Used when delete the Vpc.update
- (Defaults to 5 mins) Used when update the Vpc.Vpc Vpc can be imported using the id, e.g.
$ terraform import alicloud_vpc.example <id>