Closed lmayorga1980 closed 5 years ago
Running into the same issue after upgrading to the latest versions.
The error stopped happening after I switch to a string in the output.tf
before
value = ["${openstack_compute_instance_v2.agent.*.access_ip_v4}"]
after
value = "${openstack_compute_instance_v2.agent.access_ip_v4}"
Yeah, this makes sense according to the error. Unfortunately I need the lists. It's probably something rather easy to fix, but my Ruby knowledge is non-existent.
Ok I was able to test in both scenarios and it seems like there is an extra array of 1 element around the already existing array
Using Arrays in outputs.tf
This works because of that extra array return by @hosts = @hosts.+ Array hosts[0]
Maybe the proper logic needs to be added during the fetch
method
Apparently Terraform 0.12.7 made a nested list of the output, so that's why kitchen-terraform cannot parse it anymore:
consul_ips = [
[
"10.xxx.xxx.11",
"10.xxx.xxx.11",
"10.xxx.xxx.11",
],
]
Interesting that I did not that change coming https://github.com/hashicorp/terraform/releases on their 0.12.7
release page.
Apparently we still had explicit brackets surrounding some of our outputs, causing the nested lists.
@aaron-lane I think this should be tagged as a bug with affect versions 0.12.x
I think this could be partially addressed by #354, but as @edmeister noted, this is a result of Terraform 0.12 removing the need for much of the extraneous string interpolation from previous versions. Outputs which are simply forwarding lists from resources or other sources no longer need to be surrounded by brackets. I'm not clear on a use case for a nested list providing values to hosts_output
, but if there is one, please share it here.
This can be closed as I was able to update output.tf
and remove the extra brackets.
I was able to add some debugging and got this
test_path
test/integration/agent/controls/
output.tf
kitchen.yml
terraform:
0.12.7
ruby:
2.5.1
gemset