terraform-provider-openstack: allowed_address_pairs does not accept list
allowed_address_pairs does not accept (correct?) interpolated parameter.
Terraform Version
0.11
Affected Resource(s)
- openstack_networking_port_v2
Terraform Configuration Files
First declare 10 ports:
resource "openstack_networking_port_v2" "vip" {
name = "mytest-${count.index}"
network_id = "${openstack_networking_network_v2.net-backend.id}"
admin_state_up = "true"
count = "10"
}
Next, create port where those 10 addresses are allowed:
resource "openstack_networking_port_v2" "port" {
name = "mytest"
admin_state_up = "true"
network_id = "${openstack_networking_network_v2.net-backend.id}"
allowed_address_pairs = "${formatlist("{ip_address=\"%v\"}",
openstack_networking_port_v2.vip.*.all_fixed_ips.0)}"
}
Actual result
Error: openstack_networking_port_v2.port: allowed_address_pairs: should be a list
If you output the interpolation:
output "mylist" {
value="${formatlist("{ ip_address=\"%v\" }", openstack_networking_port_v2.vip.*.all_fixed_ips.0)}"
}
you get:
mylist = [
{ ip_address="100.127.172.186" },
{ ip_address="100.127.172.19" },
{ ip_address="100.127.172.180" },
{ ip_address="100.127.172.18" },
{ ip_address="100.127.172.182" },
{ ip_address="100.127.172.184" },
{ ip_address="100.127.172.189" },
{ ip_address="100.127.172.183" },
{ ip_address="100.127.172.179" },
{ ip_address="100.127.172.181" }
]
And if you copypaste this output to the .tf file, it works. But that’s not what you want to do 😃
About this issue
- Original URL
- State: open
- Created 7 years ago
- Comments: 22 (7 by maintainers)
Any chance to move on with this? I’m really pissed off by workarounding this 🙄
@splashx I don’t need this anymore. I can ask my then-employer to use HCL2 …
@michalmedvecky you should use the new syntax of HCL2 (terraform 0.12):
Of course one can use a list of IPs in splat syntax instead of
some_list_of_ips.This issue should be closed.