title: Using terraform, how to create multiple resources of same type with unique and unidentical names using list/count for azure?
body: <p>Here is a basic example for what I am trying to achieve. I have two files (main.tf) and (variable.tf), I want to create two resource groups and in the variables file is a list of names which I want the resource groups to occupy. First name of the first resource group and similarly going forward.
  So help me out on how to achieve it. I am using terraform v0.13.</p>
  <p><strong>main.tf file:</strong></p>
  <pre><code>provider &quot;azurerm&quot; {
   features {}
  }
  
  
  resource &quot;azurerm_resource_group&quot; &quot;test&quot; {
    count    = 2
    name     = var.resource_group_name
    location = var.location
  }
  </code></pre>
  <p><strong>variable.tf file:</strong></p>
  <pre><code>  variable &quot;resource_group_name&quot; {
    description = &quot;Default resource group name that the network will be created in.&quot;
    type        = list
    default     = [&quot;asd-rg&quot;,&quot;asd2-rg&quot;]
  
  }
  
  
  
  variable &quot;location&quot; {
    description = &quot;The location/region where the core network will be created.
    default     = &quot;westus&quot;
  }
  </code></pre>