Provides a VPC Ipv4 Cidr Block resource. VPC IPv4 additional network segment.
For information about VPC Ipv4 Cidr Block and how to use it, see What is Ipv4 Cidr Block.
Basic Usage
variable "name" {
default = "terraform-example"
}
provider "alicloud" {
region = "cn-hangzhou"
}
resource "alicloud_vpc" "defaultvpc" {
description = var.name
}
resource "alicloud_vpc_ipv4_cidr_block" "default" {
secondary_cidr_block = "192.168.0.0/16"
vpc_id = alicloud_vpc.defaultvpc.id
}
The following arguments are supported:
secondary_cidr_block
- (Required, ForceNew) The IPv4 CIDR block. Take note of the following requirements:
vpc_id
- (Required, ForceNew) The ID of the VPC.The following attributes are exported:
id
- The ID of the resource supplied above.The value is formulated as <vpc_id>:<secondary_cidr_block>
.The timeouts
block allows you to specify timeouts for certain actions:
create
- (Defaults to 5 mins) Used when create the Ipv4 Cidr Block.delete
- (Defaults to 5 mins) Used when delete the Ipv4 Cidr Block.VPC Ipv4 Cidr Block can be imported using the id, e.g.
$ terraform import alicloud_vpc_ipv4_cidr_block.example <vpc_id>:<secondary_cidr_block>