Terraform provider reference / resources / ip
fiberax_ip (Resource)
A public IPv4 address of the project.
It is charged from the moment you take it until you release it, whether or not it sits on a server. It outlives the server and keeps costing money until it is released: when Terraform destroys or replaces a server that names this address (public_ipv4 = { id = ... }), the provider asks the platform to keep it (release_ips=false), so it stays with the project and moves to the new server on replacement; destroy releases it through this resource. Only an address the server took with new = true is released together with the server. This is how 0.7.0 and later behave: 0.6.0 and earlier send no choice, and the platform then releases every address of the destroyed or replaced server, this one included.
Where the address goes is not decided by this resource: the attachment lives in the server's network card (fiberax_network_interface, field ips) or is set when the server is created. An address on net0, the card the server was created with, cannot be taken off it from Terraform: the guide "Public addresses and what they cost" gives the way.
Example Usage
# A public address is a SEPARATE billable resource.
#
# It is charged from the moment you take it until you release it, whether or not it sits
# on a server: destroying a server that names it with public_ipv4 = { id = ... } does NOT
# release the address (provider 0.7.0 and later). Destroying this resource releases it.
resource "fiberax_ip" "web" {
# The server type picks the POOL the address comes from. An address from another pool
# is not routed on the server, and the platform cannot move an address once it has been
# issued - so changing this field takes a NEW address in place of the old one.
server_type_id = 4
}
# The address is attached to the server when the server is created...
resource "fiberax_server" "web" {
name = "web-01"
server_type_id = 4
image = "fcf9f69c8630904c1d6d73a821f4e674"
cores = 2
memory_mb = 2048
disk_gb = 20
public_ipv4 = {
id = fiberax_ip.web.id
}
}
output "web_address" {
value = fiberax_ip.web.address
}
Schema
Optional
server_type_id(Number) Take the address from the pool serving this server type. Omit and the project's own location is used.
This is not just an annotation but a CHOICE OF POOL: server types have different pools, and an address from another pool IS NOT ROUTED on the server. The platform cannot move an issued address to another pool, so changing this field recreates the resource - it releases the old address and takes a new one, with a different address value.
The field IS NOT READ BACK: the platform does not report the pool of an address. The provider keeps the value you asked for and does not reconcile it with the platform.
Read-Only
address(String) The address itself, for example77.88.234.15.gateway(String) Gateway of the subnet.id(Number) ID of the address. Use it to put the address on a card and to release it.netmask(String) Subnet mask in dotted form.prefix(String) Prefix length with a leading slash, for example/25.primary(Boolean) The server's primary address: the one it presents as its own.server_id(Number) Server the address is attached to. Empty for a free address - a free address is billed just the same.
Import
Import is supported using the following syntax:
The terraform import command can be used, for example:
# An existing address is imported by its ID (a number, not the address itself). The IDs # are in the response of GET /v1/ips. terraform import fiberax_ip.web 108 # WHAT YOU HAVE TO WRITE BY HAND: the server type whose pool the address came from. The # platform does not report the pool, so the provider neither knows it nor invents it.
Generated from the provider schema for version 0.11.0. How to install the provider: Terraform provider.