title: terraform aws add route to route table error
body: <p>I need to add the same route to a route table (specified by a user as a list) however when I run terraform apply the first time, it errors out with:</p>
  
  <blockquote>
    <p>Error applying plan:</p>
    
    <p>1 error(s) occurred:</p>
    
    <ul>
    <li><p>module.vpn.aws_route.route[0]: 1 error(s) occurred:</p></li>
    <li><p>aws_route.route.0: InvalidParameterValue: There is no route defined for '172.64.0.0/16' in the route table. Use CreateRoute instead.
    status code: 400, request id: b229d66a-e47b-40b2-acf5-6c4c4a8598ba</p></li>
    </ul>
  </blockquote>
  
  <p>when I run it the second time (w/o changing anything) it runs fine. </p>
  
  <p>here's the terraform code</p>
  
  <pre><code>resource "aws_instance" "vpn" {
    ami = "${var.ami}"
    instance_type = "${var.instance_type}"
    subnet_id = "${var.subnet_id}"
    associate_public_ip_address = "${var.associate_public_ip_address}"
    source_dest_check = "${var.source_dest_check}"
    vpc_security_group_ids = ["${aws_security_group.hub.id}"]
  }
  
  resource "aws_route" "route" {
    count = "${length(var.route_tables)}"
    route_table_id = "${element(var.route_tables, count.index)}"
    destination_cidr_block = "${var.destcidrblock}"
    instance_id = "${aws_instance.vpn.id}"
  }
  </code></pre>