I’m having a hard time figuring out how to using list output in another module as a dependency.
I do working with Terragrunt v0.23.17, Terraform v0.12.24
In module output variable code is like
variable “public_lb_a_b” {
type =list
default = [
“subnet-a”,
“subnet-b”
]
}
output “public_lb_a_b” {
value = var.public_lb_a_b
description = “A_B”
}
I want to use the output as a dependency, code is like terragrunt.hcl
dependency “vpc” {
config_path = “…/vpc”
}
public_lb_a_b = dependency.vpc.outputs.public_lb_a_b
When I do apply (terragrunt apply )
the variable outputs warped with jsonencode
- subnets = [
+ jsonencode(
[
+ “subnet-d7e6c3a1”,
+ “subnet-baa090de”,
]
),
]
My expectation is
- subnets = [
+ “subnet-d7e6c3a1”,
+ “subnet-baa090de”,
]
So I end up with an error The subnet ID ‘[“subnet-a”,“subnet-b”]’ is not valid. What I’m missing here?