title: Terraform: How to create multiple aws subnets from one resource block?
body: <p>I'm trying to create multiple subnets from one resource block and I get the following error </p>
  
  <blockquote>
    <p>Error: aws_subnet.private: cidr_block must be a single value, not a list</p>
  </blockquote>
  
  <p><strong>main.tf</strong></p>
  
  <pre><code>resource "aws_subnet" "private" {
    vpc_id                  = "${aws_vpc.vpcname.id}"
    cidr_block              = "${var.private_subnet}"
    availability_zone       = "${data.aws_availability_zones.available.names[count.index]}"
    map_public_ip_on_launch = false
  
    tags {
      Name        = "${var.private}"
      Environment = "${terraform.workspace}"
    }
  }
  </code></pre>
  
  <p><strong>variable.tf</strong></p>
  
  <pre><code>variable "private_subnet" {
    type    = "list"
    default = []
  }
  </code></pre>
  
  <p><strong>dev.tfvars</strong></p>
  
  <pre><code>private_subnet = ["10.0.2.0/24", "10.0.3.0/24"]
  </code></pre>