github.com/adamar/terraform@v0.2.2-0.20141016210445-2e703afdad0e/website/source/docs/providers/aws/r/subnet.html.markdown (about) 1 --- 2 layout: "aws" 3 page_title: "AWS: aws_subnet" 4 sidebar_current: "docs-aws-resource-subnet" 5 --- 6 7 # aws\_subnet 8 9 Provides an VPC subnet resource. 10 11 ## Example Usage 12 13 ``` 14 resource "aws_subnet" "main" { 15 vpc_id = "${aws_vpc.main.id}" 16 cidr_block = "10.0.1.0/24" 17 } 18 ``` 19 20 ## Argument Reference 21 22 The following arguments are supported: 23 24 * `availability_zone`- (Optional) The AZ for the subnet. 25 * `cidr_block` - (Required) The CIDR block for the subnet. 26 * `map_public_ip_on_launch` - (Optional) Specify true to indicate 27 that instances launched into the subnet should be assigned 28 a public IP address. 29 * `vpc_id` - (Required) The VPC ID. 30 31 ## Attributes Reference 32 33 The following attributes are exported: 34 35 * `id` - The ID of the subnet 36 * `availability_zone`- The AZ for the subnet. 37 * `cidr_block` - The CIDR block for the subnet. 38 * `vpc_id` - The VPC ID. 39