title: How do I assign unique "Name" tag to the EC2 instance(s)?
body: <p>I am using Terraform 0.12.  I am trying to build EC2 in bulk for a project and instead of sequentially naming the ec2's I will to name the instances by providing unique names.  </p>
  
  <p>I think of using dynamic tags, however, not quite sure how to incorporate in the code.</p>
  
  <pre><code>resource "aws_instance" "tf_server" {
    count         = var.instance_count
    instance_type = var.instance_type
    ami           = data.aws_ami.server_ami.id
    associate_public_ip_address = var.associate_public_ip_address
  
  ##This provides sequential name.
    tags = {
      Name = "tf_server-${count.index +1}"
    }
  
    key_name               = "${aws_key_pair.tf_auth.id}"
    vpc_security_group_ids = ["${var.security_group}"]
    subnet_id              = "${element(var.subnets, count.index)}"
  }
  </code></pre>