Skip to content

Search is only available in production builds. Try building and previewing the site to test it out locally.

Floating IP

platform_floating_ip allocates a floating IP. Set instance_id to associate it. Changing instance_id disassociates and/or associates in place. type and region force replacement.

resource "platform_floating_ip" "web" {
name = "web-public"
type = "ipv4"
}

Associate at create (or later) with an instance id:

resource "platform_floating_ip" "web" {
name = "web-public"
type = "ipv4"
instance_id = platform_instance.web.id
}
NameRequiredNotes
namenoDisplay name
typenoFor example ipv4. Computed if omitted. Forces replacement
regionnoComputed if omitted. Forces replacement
instance_idnoAssociate to this instance. Updated in place
NameNotes
idPlatform id
addressAllocated address

Destroy releases the address.

Terminal window
terraform import platform_floating_ip.web fip_…

Read maps the current association back onto instance_id.