github.com/danp/terraform@v0.9.5-0.20170426144147-39d740081351/website/source/docs/providers/aws/r/vpc.html.markdown (about) 1 --- 2 layout: "aws" 3 page_title: "AWS: aws_vpc" 4 sidebar_current: "docs-aws-resource-vpc" 5 description: |- 6 Provides an VPC resource. 7 --- 8 9 # aws\_vpc 10 11 Provides an VPC resource. 12 13 ## Example Usage 14 15 Basic usage: 16 17 ```hcl 18 resource "aws_vpc" "main" { 19 cidr_block = "10.0.0.0/16" 20 } 21 ``` 22 23 Basic usage with tags: 24 25 ```hcl 26 resource "aws_vpc" "main" { 27 cidr_block = "10.0.0.0/16" 28 instance_tenancy = "dedicated" 29 30 tags { 31 Name = "main" 32 } 33 } 34 ``` 35 36 ## Argument Reference 37 38 The following arguments are supported: 39 40 * `cidr_block` - (Required) The CIDR block for the VPC. 41 * `instance_tenancy` - (Optional) A tenancy option for instances launched into the VPC 42 * `enable_dns_support` - (Optional) A boolean flag to enable/disable DNS support in the VPC. Defaults true. 43 * `enable_dns_hostnames` - (Optional) A boolean flag to enable/disable DNS hostnames in the VPC. Defaults false. 44 * `enable_classiclink` - (Optional) A boolean flag to enable/disable ClassicLink 45 for the VPC. Only valid in regions and accounts that support EC2 Classic. 46 See the [ClassicLink documentation][1] for more information. Defaults false. 47 * `assign_generated_ipv6_cidr_block` - (Optional) Requests an Amazon-provided IPv6 CIDR 48 block with a /56 prefix length for the VPC. You cannot specify the range of IP addresses, or 49 the size of the CIDR block. Default is `false`. 50 * `tags` - (Optional) A mapping of tags to assign to the resource. 51 52 ## Attributes Reference 53 54 The following attributes are exported: 55 56 * `id` - The ID of the VPC 57 * `cidr_block` - The CIDR block of the VPC 58 * `instance_tenancy` - Tenancy of instances spin up within VPC. 59 * `enable_dns_support` - Whether or not the VPC has DNS support 60 * `enable_dns_hostnames` - Whether or not the VPC has DNS hostname support 61 * `enable_classiclink` - Whether or not the VPC has Classiclink enabled 62 * `main_route_table_id` - The ID of the main route table associated with 63 this VPC. Note that you can change a VPC's main route table by using an 64 [`aws_main_route_table_association`](/docs/providers/aws/r/main_route_table_assoc.html). 65 * `default_network_acl_id` - The ID of the network ACL created by default on VPC creation 66 * `default_security_group_id` - The ID of the security group created by default on VPC creation 67 * `default_route_table_id` - The ID of the route table created by default on VPC creation 68 * `ipv6_association_id` - The association ID for the IPv6 CIDR block. 69 * `ipv6_cidr_block` - The IPv6 CIDR block. 70 71 72 [1]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/vpc-classiclink.html 73 74 ## Import 75 76 VPCs can be imported using the `vpc id`, e.g. 77 78 ``` 79 $ terraform import aws_vpc.test_vpc vpc-a01106c2 80 ```