title: Terraform > Resource > name - invalid or unknown key
body: <p>According to this <a href="https://www.terraform.io/docs/configuration/resources.html" rel="nofollow noreferrer">https://www.terraform.io/docs/configuration/resources.html</a> you can have a <code>resource</code> with a <code>name</code>. E.g. </p>
  
  <pre><code>resource "aws_db_instance" "timeout_example" {
    allocated_storage = 10
    engine            = "mysql"
    engine_version    = "5.6.17"
    instance_class    = "db.t1.micro"
    name              = "mydb"
  
    # ...
  
    timeouts {
      create = "60m"
      delete = "2h"
    }
  }
  </code></pre>
  
  <p>but my sample <code>tf</code> file:</p>
  
  <pre><code>provider "aws" {
    access_key = "&lt;access key&gt;"
    secret_key = "&lt;secret key&gt;"
    region     = "us-east-1"
  }
  
  resource "aws_instance" "web" {
    ami           = "ami-0d729a60"
    instance_type = "t2.micro"
    subnet_id = "&lt;subnet-id&gt;"
    name = "web"
  }
  </code></pre>
  
  <p>gives me <code>* aws_instance.web: : invalid or unknown key: name</code>. </p>
  
  <p>Any idea why?</p>