mirror of
https://github.com/opentofu/opentofu.git
synced 2025-02-20 11:48:24 -06:00
The variable validator assumes that any AST node it gets from an
interpolation walk is an indicator of an interpolation. Unfortunately,
back in f223be15
we changed the interpolation walker to emit a LiteralNode
as a way to signal that the result is a literal but not identical to the
input due to escapes.
The existence of this issue suggests a bit of a design smell in that the
interpolation walker interface at first glance appears to skip over all
literals, but it actually emits them in this one situation. In the long
run we should perhaps think about whether the abstraction is right here,
but this is a shallow, tactical change that fixes #13001.
15 lines
352 B
HCL
15 lines
352 B
HCL
variable "var_with_escaped_interp" {
|
|
# This is here because in the past it failed. See Github #13001
|
|
default = "foo-$${bar.baz}"
|
|
}
|
|
|
|
resource "test_instance" "foo" {
|
|
ami = "bar"
|
|
|
|
# This is here because at some point it caused a test failure
|
|
network_interface {
|
|
device_index = 0
|
|
description = "Main network interface"
|
|
}
|
|
}
|