How can I define more than one `allowed_address_pa...
# python
a
How can I define more than one
allowed_address_pairs
for an Openstack port? This only uses the latest `ip_address`:
Copy code
allowed_address_pairs=[{'ip_address': config.kube_service_addresses,
                       'ip_address': config.kube_pods_subnet}]
w
Looks like you currently cannot - this is tracked in the upstream provider at: https://github.com/terraform-providers/terraform-provider-openstack/issues/174
cc also @stocky-spoon-28903 though - as it sounds like there might be a workaround there?
s
I’m not 100% familiar with python syntax here (so this might not be the issue) but it looks to me like the second is overriding the first because it’s setting the same key on a map, whereas we want an array of maps for
allowed_address_pairs
- in the NodeJS SDK it gets projected as an array of objects (https://github.com/pulumi/pulumi-openstack/blob/master/sdk/nodejs/networking/port.ts#L248)
The upstream issue with Terraform I don’t think is the same - that’s about not being able to use an interpolated list in place of a repeating block in HCL configuration.
a
Thanks for investigating this! I did find one Terraform pull request regarding this but it had just 2
allowed_address_pairs
defined one after another. I'll explore this more once I have time.