okustera_floating_ip_associate (Resource)
Binds an allocated public routable IPv4 address to a target Neutron network interface port, enabling external internet ingress and egress for virtual machine instances.
Example Usage
Associate Floating IP to Compute Instance Interface Port
resource "okustera_compute_instance" "web" {
name = "web-server-01"
flavor_id = data.okustera_compute_flavor.m1_small.id
image_id = data.okustera_image.ubuntu.id
}
# Lookup the auto-provisioned network port for the VM
data "okustera_port" "web_port" {
device_id = okustera_compute_instance.web.id
}
# Allocate a public IPv4 address
resource "okustera_floating_ip" "web_ip" {
description = "Public ingress for web-server-01"
}
# Bind the public IP to the instance port
resource "okustera_floating_ip_associate" "web_assoc" {
floating_ip_id = okustera_floating_ip.web_ip.id
port_id = data.okustera_port.web_port.id
}
output "public_ip" {
value = okustera_floating_ip_associate.web_assoc.floating_ip_address
}
Schema
Required
floating_ip_id(String, Forces new resource) UUID of the allocated floating IP to associate.port_id(String, Forces new resource) UUID of the Neutron network port to bind the floating IP to.
Optional
fixed_ip_address(String) Specific private IPv4 address on the target port to bind (useful when a port has multiple secondary IPs).
Read-Only
id(String) Matches thefloating_ip_id.floating_ip_address(String) Public IPv4 address bound to the port.
Import
Floating IP associations can be imported using the floating_ip_id:
terraform import okustera_floating_ip_associate.example "fip-12345-uuid"