title: Terraform AWS subnet_id list is treated as single value string for ec2 instance
body: <p>I have code to create VPC, with 2 private subnets, 2xec2 instances in private and bastion in public. </p>
  
  <p>ec2 code uses outputs.tf of VPC module subnet_ids. as there are 2 private subnets there are 2 subnet_ids being generated. when these generated subnet_ids are fed into ec2 instances instead of one subnet_id, it is feeding 2 subnet_ids at once as a single value.</p>
  
  <p>As a result terraform couldn't find that subnet_ids value, creation is being failed.</p>
  
  <p>error:
  The subnet ID 'subnet-0***********,subnet-0*************' does not exist</p>
  
  <p>editing subnets*
  vpc.tf</p>
  
  <pre><code>private_subnets     = "10.10.20.#/#,10.10.20.#/#"
  </code></pre>
  
  <p>instanceec2.tf</p>
  
  <pre><code>subnet_id           = "${module.vpc.private_subnets}"
  </code></pre>
  
  <p>below are modules:</p>
  
  <p>vpc_main.tf</p>
  
  <pre><code>// Private subnet/s
  resource "aws_subnet" "private" {
    vpc_id            = "${aws_vpc.vpc.id}"
    cidr_block        = "${element(split(",", var.private_subnets), count.index)}"
    availability_zone = "${element(split(",", var.azs), count.index)}"
    count             = "${length(split(",", var.private_subnets))}"
  
    tags {
      Name        = "${var.name}-private-${element(split(",", var.azs), count.index)}"
      Team        = "${var.team}"
      Environment = "${var.environment}"
      Service     = "${var.service}"
      Product     = "${var.product}"
      Owner       = "${var.owner}"
      Description = "${var.description}"
      managed_by  = "terraform"
    }
  }
  
  resource "aws_route_table" "private" {
    vpc_id = "${aws_vpc.vpc.id}"
    count  = "${length(split(",", var.private_subnets))}"
  
    tags {
      Name        = "${var.name}-private-${element(split(",", var.azs), count.index)}"
      Team        = "${var.team}"
      Environment = "${var.environment}"
      Service     = "${var.service}"
      Product     = "${var.product}"
      Owner       = "${var.owner}"
      Description = "${var.description}"
      managed_by  = "terraform"
    }
  }
  
  resource "aws_route_table_association" "private" {
    subnet_id      = "${element(aws_subnet.private.*.id, count.index)}"
    route_table_id = "${element(aws_route_table.private.*.id, count.index)}"
    count          = "${length(split(",", var.private_subnets))}"
  }
  ``````
  
  
  vpc_outputs.tf
  
  ```````
  
  output "private_subnets" {
    value = "${join(",", aws_subnet.private.*.id)}"
  }
  </code></pre>
  
  <p>Expected value is only one subnet ID as value:</p>
  
  <p>Error: supply 2 Subnet IDs as one value.</p>
  
  <p>aws_instance.ec2-instance[0]: 1 error(s) occurred:</p>
  
  <ul>
  <li>aws_instance.ec2-instance.0: Error launching source instance: InvalidSubnetID.NotFound: The subnet ID 'subnet-0**********,subnet-0***********' does not exist</li>
  </ul>