I need a local variable to refer to the resource type AWS.
When I use that variable inside the resource block, it can assign it to a variable,
I’m pretty sure my syntax is incorrect, and I’m looking for help with it.
example locals.tf file:
locals {
common_tags = {
“ResourceName” = “{resource_type.name}”
}
}
Example main.tf file:
resource “aws_instance” “server” {
tags = merge(
local.common_tags,
)
}
Example AWS result in Tags:
Resource_name = aws_instance
Let me know,
I can’t find any examples on how to do this…
Thank you
Craig Ellrod (“surfd4wg”)