title: Terraform - A reference to resource type must be followed by at least one attribute access, specifying the resource name
body: <p>I am trying to use terraform string function and string concatenation on a terraform tfvars variable. but when run the terraform plan it through the below exception</p>
  <blockquote>
  <p>Error: A reference to a resource type must be followed by at least one attribute
  access, specifying the resource name.</p>
  </blockquote>
  <p>Following is the terraform code</p>
  <pre><code>locals {
    name_suffix = &quot;${var.namespace != &quot;&quot; ? var.namespace : var.env}&quot;
  }
  
  resource &quot;azurerm_container_registry&quot; &quot;my_acr&quot; {
    name                = &quot;myacr${replace(name_suffix, &quot;-&quot;, &quot;&quot;)}&quot;
    location            = &quot;${azurerm_resource_group.location}&quot;
    resource_group_name = &quot;${azurerm_resource_group.name}&quot;
    sku                 = &quot;Basic&quot;
    admin_enabled       = true
  } 
  </code></pre>
  <p>Here namespace value will be resolved at runtime.</p>
  <p>Terraform version 0.12.7</p>