Closed
Description
# terragrunt.hcl
terraform {
source = "..."
}
inputs = {
name ="something" # <-- this does not work
# name = jsonencode("something") # <-- this works
}
# module/main.tf
variable "name" {
type = any # Works as expected when type is not `any`
default = null
}
The error message:
Error: Invalid expression
on <value for var.name> line 1:
(source code not available)
Expected the start of an expression, but found an invalid expression token.
It looks like terragrunt should do JSON encode for all variables, but I am not sure if it is a BC break, or not.
Using terragrunt version v0.23.23 and Terraform 0.12.26.
The workaround, for now, is to know which variables have "type = any" and wrap value with jsonencode()
.
Activity