Closed wesleykonderla closed 5 years ago
I think it's a side effect of converting input
to env vars for terraform.
It's like double conversion: in inputs
the variables have types, then they get converted to env vars like
TF_VAR_tgw_route_propagation_cidrs='["10.0.0.0/8", "172.16.0.0/12", "192.168.0.0/16"]'
and then terraform converts them back assigning the right type, which I assume string
by default.
You didn't show the variables declaration, but it appears, you just need to set the type in the variable declaration like so:
variable "tgw_route_propagation_cidrs" {
type = set(string)
}
or
variable "tgw_route_propagation_cidrs" {
type = list(string)
}
Makes sense. Based on my understanding of what you said, I guess it was working before without terragrunt because terraform was able to infer the correct type? I will double check tomorrow when I get back in the office that it works and I can close this issue. Thanks!
Yes, because if you have it set in a .tfvars
file, then terraform correctly guesses the type.
+1 on @ekini's idea. We pass the variables using env vars, and Terraform most likely needs you to specify a type
to parse those env vars correctly. Let us know if that works!
That definitely fixed the issue. Thanks guys!
Howdy!
First off, thanks guys for all the effort in pushing 0.19 out soo fast. I've been following along and just finished moving some working 0.12 TF code over to terragrunt but am encountering an issue with using functions or expressions on sets/lists.
I have encountered the following errors:
Files referenced:
Note: The module.vpc being referenced is the terraform-aws-vpc module.
Without digging too deep into this, I suspect it might have to do with how the values are being interpolated. I've tried this with the new "for" expressions as well and encountered similar errors. I have tested the code with just terraform 0.12 prior to moving to terragrunt 0.19 and it worked, if that helps.