https://pulumi.com logo
#python
Title
# python
a

alert-monitor-28534

03/20/2019, 6:50 AM
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

white-balloon-205

03/20/2019, 4:29 PM
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

stocky-spoon-28903

03/20/2019, 5:26 PM
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

alert-monitor-28534

03/21/2019, 11:11 AM
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.
2 Views