I want to create my openstack terraform instance in a specific existing (i.e. not created by terraform) subnet of a network. I can create the port in the subnet and assign it to the instance - however I need to know the subnet UUID when I create the port.
How can I obtain the subnet UUID through terraform ? I see I can import a subnet into the state file with 'import' but I still need to know the UUID.
I can obtain the network details with data.openstack_networking_network_v2. Is there anyway to obtain a data.openstack_networking_subnet_v2 query?
resource "openstack_networking_port_v2" "m1ck_small_Chris_Subnet" {
name = "m1ck_small_Chris_subnet"
network_id = "${data.openstack_networking_network_v2.network_1.id}"
admin_state_up = "true"
fixed_ip {
subnet_id = "c58354a4-4cb1-4863-9fce-fad5cd76b19b"
}
}
How can terraform determine the subnet_id of an existing subnet?
Something like
data "openstack_networking_subnet_v2" "subnet1" {
name = "subnet_name"
network_id = "network_id"
}