lookup: lookup() may only be used with flat maps, this map contains elements of type listoutput "test" {
value = "${
map(
"test", ["one","two","three"]
)
}"
}--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
GitHub Issues: https://github.com/hashicorp/terraform/issues
IRC: #terraform-tool on Freenode
---
You received this message because you are subscribed to the Google Groups "Terraform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to terraform-tool+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/terraform-tool/677b4536-18d3-4287-a073-9a1911492f4b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
lookup() can only return a string. So your map's value will need to be a string rather than a list. You can work around this by using commas (or something else) as a separator, then splitting:"${element(split(",",lookup(module.mod.test, "test")),count.index)}"That may not be exactly right, but hopefully conveys the idea. This is an area that has gotten a lot of work, but is clearly pretty complicated to implement, so often you have to resort to what feel like hacks. But it's way better than it used to be :)
On Tue, Nov 8, 2016 at 10:56 AM, Andy <andys...@comcast.net> wrote:
It seems like I am trying to do something that is not possible but I thought I would ask here since I am new to terraform.
I have this output that I want to consume in a module. If I try to access this in any way with the lookup function I will receive the errors:lookup: lookup() may only be used with flat maps, this map contains elements of type listoutput "test" {
value = "${
map(
"test", ["one","two","three"]
)
}"
}
Is this just simply not possible or am I missing the proper way to access a list index with the lookup function?
Thanks
Andy
--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
GitHub Issues: https://github.com/hashicorp/terraform/issues
IRC: #terraform-tool on Freenode
---
You received this message because you are subscribed to the Google Groups "Terraform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to terraform-too...@googlegroups.com.