We have been doing,
node_selector = var.node_group != null ? { “${var.node_group}” = true } : null
and in tfvars we will have, node_selector = “NODEGROUP2” And it works correctly.
Tflint is throwing a warning on it as below, Warning: Interpolation-only expressions are deprecated in Terraform v0.12.14 (terraform_deprecated_interpolation)
Trying to understand what exactly its throwing warning and possible fixes? Is it complaining on “${}” and I have to set to set it as var.node_group ?
setting the line as,
node_selector = var.node_selector != null ? { “var.node_selector” = true } : null
clear the tflint warning, however value is not being replaced for var.node_selector
May be I can make my question much simpler, How do I make below work?
resource "random_pet" "this" {
keepers = {
"var.key" = "test"
}
}
variable "key" {
type = string
description = "test"
default = "ami_id"
}
Any thoughts?
Thanks.