github.com/candidpartners/terraform@v0.9.5-0.20171005231213-29f5f88820f6/examples/aws-networking/subnet/subnet.tf (about)

     1  resource "aws_subnet" "main" {
     2    cidr_block = "${cidrsubnet(data.aws_vpc.target.cidr_block, 4, lookup(var.az_numbers, data.aws_availability_zone.target.name_suffix))}"
     3    vpc_id     = "${var.vpc_id}"
     4  }
     5  
     6  resource "aws_route_table" "main" {
     7    vpc_id = "${var.vpc_id}"
     8  }
     9  
    10  resource "aws_route_table_association" "main" {
    11    subnet_id      = "${aws_subnet.main.id}"
    12    route_table_id = "${aws_route_table.main.id}"
    13  }