Hi there,
I'd like to ask how the ip_address gets calculated (https://www.terraform.io/docs/providers/openstack/r/networking_router_v2.html#ip_address) for openstack_networking_router_v2 resource? The reason for asking is the following use case:
My openstack project has an external network which is divided into two subnets.
The default configuration for router looks as follows:
resource "openstack_networking_router_v2" "terrakube_router" {
name = "${var.k8s_cluster_name}_router"
admin_state_up = true
external_network_id = "${data.openstack_networking_network_v2.terrakube_external_network.id}"
}
When I create a router like this and specify only the external_network_id, the first one of the subnets is being attached successfully. If I try to attach the second one instead, I specify the external_fixed_ip argument as follows:
resource "openstack_networking_router_v2" "terrakube_router" {
name = "${var.k8s_cluster_name}_router"
admin_state_up = true
external_network_id = "${data.openstack_networking_network_v2.terrakube_external_network.id}"
external_fixed_ip {
subnet_id = "${data.openstack_networking_subnet_v2.terrakube_external_subnet.id}"
}
}
This code causes an error:
* module.terrakube.openstack_networking_router_v2.terrakube_router: 1 error(s) occurred:
* openstack_networking_router_v2.terrakube_router: Error creating OpenStack Neutron router: Bad request with: [POST https://network-3.eu-de-2.cloud.sap/v2.0/r
outers], error message: {"NeutronError": {"message": "Invalid input for external_gateway_info. Reason: '' is not a valid IP address.", "type": "HTTPBadRequest
", "detail": ""}}
I could hardcode the value of the IP but that seems to be an ugly solution, so I would like to find out how to get it via terraform data sources or using some other approach?
Terraform Version
Terraform v0.11.8
- provider.ccloud (unversioned)
- provider.openstack v1.10.0
Thanks!
Hi there,
I'd like to ask how the ip_address gets calculated (https://www.terraform.io/docs/providers/openstack/r/networking_router_v2.html#ip_address) for openstack_networking_router_v2 resource? The reason for asking is the following use case:
My openstack project has an external network which is divided into two subnets.
The default configuration for router looks as follows:
When I create a router like this and specify only the
external_network_id, the first one of the subnets is being attached successfully. If I try to attach the second one instead, I specify theexternal_fixed_ipargument as follows:This code causes an error:
I could hardcode the value of the IP but that seems to be an ugly solution, so I would like to find out how to get it via terraform data sources or using some other approach?
Terraform Version
Terraform v0.11.8
Thanks!