terraform/builtin/providers
Daniel Farina 67b03247ec Make Routes in RouteTable optional
Otherwise it is impossible to get simple configurations with the
"default" routing table, which is only the "local" route.

The following contents of main.tf expose the bug, and boots an instance
fine after this patch is applied:

    variable aws_access_key {}
    variable aws_secret_key {}
    variable aws_ubuntu_ami {}

    provider "aws" {
        access_key = "${var.aws_access_key}"
        secret_key = "${var.aws_secret_key}"
        region = "us-east-1"
    }

    resource "aws_vpc" "default" {
        cidr_block = "10.0.0.0/20"
    }

    resource "aws_route_table" "private" {
        vpc_id = "${aws_vpc.default.id}"
        # Note the lack of "route" sub-key here.
    }

    resource "aws_subnet" "private" {
        vpc_id = "${aws_vpc.default.id}"
        cidr_block = "10.0.1.0/24"
    }

    resource "aws_route_table_association" "private" {
        subnet_id = "${aws_subnet.private.id}"
        route_table_id = "${aws_route_table.private.id}"
    }

    # Demonstrate an instance can be booted fine in this fashion.
    resource "aws_instance" "sample" {
        ami = "${var.aws_ubuntu_ami}"
        instance_type = "t2.micro"
        subnet_id = "${aws_subnet.private.id}"
    }

terraform.tfvars for completeness:

    aws_access_key = "..."
    aws_secret_key = "..."

    # A public Trusty AMI
    aws_ubuntu_ami = "ami-9aaa1cf2"
2014-11-19 22:04:44 -08:00
..
aws Make Routes in RouteTable optional 2014-11-19 22:04:44 -08:00
cloudflare Removing obsolete struct tags 2014-11-17 18:57:41 +01:00
consul providers/consul: fix delete diff 2014-10-20 14:09:57 -07:00
digitalocean Refactor the DigitalOcean provider 2014-11-18 11:26:59 +01:00
dnsimple Removing obsolete struct tags 2014-11-17 18:58:41 +01:00
google set default host on connection info 2014-10-19 00:04:17 -07:00
heroku Fixed tests and updated the provider schema to use a DefaultFunc 2014-11-19 14:25:18 +01:00
mailgun Updated the provider to make testing a little easier 2014-11-18 15:21:32 +01:00
null providers/null: null provider 2014-10-04 16:42:43 -07:00