Created
September 1, 2019 19:13
-
-
Save styk-tv/628cfce8e5824338007e4ad13fd27925 to your computer and use it in GitHub Desktop.
Terraform Openstack Allowed Address Pairs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
locals { | |
some_list_of_ips = [ | |
"127.0.0.1", | |
"127.0.0.2", | |
"127.0.0.3" | |
] | |
} | |
resource "openstack_networking_port_v2" "test-adp" { | |
name = "some-name" | |
count = "1" | |
network_id = "ef3a3380-931e-45fc-a7b8-6a1ad3bc24ab" | |
admin_state_up = "true" | |
dynamic "allowed_address_pairs" { | |
for_each = local.some_list_of_ips | |
content { | |
ip_address = allowed_address_pairs.value | |
} | |
} | |
} | |
$ openstack port show some-name --format=json | jq '.allowed_address_pairs' | |
"ip_address='127.0.0.1', mac_address=''\nip_address='127.0.0.2', mac_address=''\nip_address='127.0.0.3', mac_address=''" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment