When I use variable interpolation within a string, the plugin inspection generates a weak warning:
Example Code:
resource "aws_vpc" "this" {
cidr_block = "10.130.0.0/19"
enable_dns_hostnames = true
tags = {
Name = "${local.env}.VPC" # <--- This line generates the warning.
}
}
Inspection Results:
Interpolation could be replaced with HCL2 expression
Inspection info: Converts to HCL2 expressions
Expected Behavior
To the best of my knowledge, when defining a variable with a string, you must still use ${} syntax.
Actual Behavior
This approach is marked as a warning as it doesn't appear the plugin sees the additional text within the quotes. A workaround in the interim is to write it as Name = local.env + ".VPC" though that is kind of ugly.
Installation details
When I use variable interpolation within a string, the plugin inspection generates a weak warning:
Example Code:
Inspection Results:
Expected Behavior
To the best of my knowledge, when defining a variable with a string, you must still use
${}
syntax.Actual Behavior
This approach is marked as a warning as it doesn't appear the plugin sees the additional text within the quotes. A workaround in the interim is to write it as
Name = local.env + ".VPC"
though that is kind of ugly.Thanks! Tom