openstack_networking_floatingip_associate_v2
This instruction is a copy of the official OpenStack Terraform provider documentation in the Terraform Registry.
Associates a floating IP with a port. This is useful in scenarios where you have a pre-allocated floating IP or cannot use the openstack_networking_floatingip_v2 resource to create a floating IP.
Example Usage
resource "openstack_networking_port_v2" "port_1" {
network_id = "a5bbd213-e1d3-49b6-aed1-9df60ea94b9a"
}
resource "openstack_networking_floatingip_associate_v2" "fip_1" {
floating_ip = "1.2.3.4"
port_id = openstack_networking_port_v2.port_1.id
}
Argument Reference
The following arguments are supported:
-
region— (необязательный) регион, in котором необходимо получить V2 Networking client. Клиент для работы with сетью необходим для создания плавающего IP-адреса, который можно использовать with другим сетевым ресурсом, например балансировщиком нагрузки. Если параметр не указан, используется аргументregionпровайдера. Изменение этого параметра приводит к созданию нового плавающего IP-адреса (который может иметь другой адрес, а может and остаться прежним). -
floating_ip- (Required) The IP address of an existing floating IP. -
port_id- (Required) ID of an existing port with at least one IP address to associate with this floating IP.
Attributes Reference
The following attributes are exported:
region- See Argument Reference above.floating_ip- See Argument Reference above.port_id- See Argument Reference above.
Import
Floating IP associations can be imported using the id of the floating IP, for example:
$ terraform import openstack_networking_floatingip_associate_v2.fip 2c7f39f3-702b-48d1-940c-b50384177ee1