title: Terraform get list index on for_each
body: <p>Terraform newbie here.
  I'd like to iterate a list using <code>for_each</code>, but it seems like the key and value are the same:</p>
  
  <pre><code>provider "aws" {
    profile = "default"
    region  = "us-east-1"
  }
  
  variable "vpc_cidrs" {
    default = ["10.0.0.0/16", "10.1.0.0/16"]
  }
  
  resource "aws_vpc" "vpc" {
    for_each             = toset(var.vpc_cidrs)
    cidr_block           = each.value
    enable_dns_hostnames = true
    tags                 = { Name = "Company0${each.key}" }
  }
  </code></pre>
  
  <p>I'd like the tag Name to be <code>"Name" = "Company01"</code> and <code>"Name" = "Company02"</code> but according to <code>terraform apply</code>, I get:
  <code>"Name" = "Company010.0.0.0/16"</code> and <code>"Name" = "Company010.1.0.0/16"</code>
  What am I missing?</p>