Assign variable to tag Name - Terraform 13

My Name tag in AWS comes out to looking like the following:
var.myname-a9c1550bc09a6832

However, I want it to look like the following:
craigums-a9c1550bc09a6832.

Here is my locals.tf file:
locals {
common_tags = {
Name = “var.myname-${random_id.server.hex}”
}
}

Here is my variables.tf:
variable “myname” {
description = “Default Name tag for AWS Resources”
default = “craigums”
}

Here is my resource declaration in main.tf:
resource “aws_instance” “webserver” {

tags = merge(
local.common_tags,

		map(
		  "Zoo", "AWS Zoofarm",
    "RESOURCE", "webserver AMI",
		)
  )

The documentation for 13 doesn’t provide much guidance.

What am I doing wrong in the locals.tf or main.tf file?

Thanks,
Craig

For the value to be interpolated you need to use the ${} mechanism.

So something like "${var.myname}-${random_id.server.hex}"

That worked, thank you!

I guess this is related… now, I need a local variable to refer to the resource_type , for example in a resource aws_instance xxxxx block,
I need the local variable in the local.tf file to do something like:
“RSRCtype” = resource_type …
if that exists.
So that the aws_instance will end up with the tag RSRCtype “aws_instance”…

if that makes any sense…