Terraform provider reference / resources / server
fiberax_server (Resource)
A server in the Fiberax project.
Size is set in TWO different ways, and which one applies is decided by the server type:
- a type sold as plans requires
plan_id, and therecores,memory_mbanddisk_gbare set by the plan itself; - a type sized by sliders requires all three numbers and refuses
plan_id.
Which types you can use and which mode each one has comes from GET /v1/server-types: the list is per project, so the provider does not name types or locations here.
Example Usage
# A server type sized by sliders: you choose the size.
resource "fiberax_server" "web" {
name = "web-01"
server_type_id = 4
image = "fcf9f69c8630904c1d6d73a821f4e674"
cores = 2
memory_mb = 2048 # whole gigabytes only
disk_gb = 20
# At least one network is required: without a network card the server is unreachable.
networks = [fiberax_network.internal.id]
# A public address is billed while the project holds it. One taken with new = true is
# released together with the server; manage it as fiberax_ip to keep it across servers.
public_ipv4 = {
new = true
}
# You must set EITHER a password OR SSH keys: a server with neither is unreachable,
# and the platform refuses such a request.
ssh_keys = [12]
tags = ["prod", "web"]
}
# A type sold as plans: the plan sets the size, and the slider fields are refused.
resource "fiberax_server" "solo" {
name = "solo-01"
server_type_id = 5
image = "fcf9f69c8630904c1d6d73a821f4e674"
plan_id = 15
networks = [fiberax_network.internal.id]
ssh_keys = [12]
}
# Power is described by a FIELD, and it has three values: true - keep it on,
# false - keep it off, NOT SET - the provider does not manage power at all.
#
# The third state is load-bearing: without it a run would silently start a server
# you powered off yourself, and resume the charges for cores and memory.
resource "fiberax_server" "cold_standby" {
name = "standby-01"
server_type_id = 4
image = "fcf9f69c8630904c1d6d73a821f4e674"
cores = 1
memory_mb = 1024
disk_gb = 10
networks = [fiberax_network.internal.id]
ssh_keys = [12]
started = false
timeouts {
create = "30m"
update = "30m"
delete = "20m"
}
}
Schema
Required
image(String) Identifier of the image - exactly the oneGET /v1/server-types/{id}/imagesreports. Changing the image on an existing server means reinstalling the system; the provider expresses that by replacing the resource.server_type_id(Number) Server type. The platform cannot move an existing server to another type.
Optional
NOTE: Write-only arguments are supported in Terraform 1.11 and later.
accept_license(Boolean) Agreement to the Microsoft licence terms. Required for Windows images and refused for images without a paid licence.cores(Number) Virtual cores. Only for types sized by sliders; on a type sold as plans this value is set by the plan.disk_gb(Number) System disk in gigabytes. Never the sum of all disks: data disks are their own resource.
The disk ONLY GROWS: the platform cannot shrink it, and a request for a smaller size is rejected.
disk_type(String) Storage class of the system disk on a type with graphics cards:localfor the disk of the host itself,cephfor shared storage. Defaults tolocal; refused on types where the class is part of the type. The disk limit differs by class - seelimitsin the type's pricing.
Chosen at creation only: moving a system disk between storage classes is not an operation of the platform.
gpu_package(String) GPU package on a server type sold as one: it defines the card, the cores, the memory and the system disk together. Required on such a type and refused on the others; take the value from thekeyfield ofgpu_packagesin the type's pricing.
A server of this kind NEVER CHANGES SIZE: neither the package nor cores, memory or disk can be edited, so a different package means a different server.
gpus(Attributes List) Graphics cards on a server type where you pick them yourself: one entry per model. Required on such a type and refused on the others.
model is the key from gpu_models of the type's pricing; naming the same model twice adds the counts up. How many cards one server may hold is limits.gpus of that pricing.
THE SET CANNOT BE CHANGED on an existing server - a different set means a different server, and the provider expresses that by replacing the resource. (see below for nested schema)
host(String) The host to place this server on, by its label (node-1). Take the value from thefiberax_server_type_hostsdata source. Omit it and the platform picks the host, which is the default.
Accepted only on server types that name their hosts; a type that does not refuses it. A chosen host with no room for this server is refused - the server is NEVER placed on another host silently.
THE HOST CANNOT BE CHANGED on an existing server: a different host means a different server, and the provider expresses that by replacing the resource. Where the server runs right now is current_host, and a move made outside Terraform changes that one, not this one.
memory_mb(Number) Memory in megabytes, which MUST be a multiple of 1024: internally the platform counts in gigabytes, and the remainder would be silently lost in the conversion.name(String) Hostname for the server. Required for every image EXCEPT a router: the platform names a router itself and does not allow renaming it.
The name of a NEW server is a host name: parts separated by single dots, each made of Latin letters, digits and hyphens and not starting or ending with a hyphen (web-1.example; not a..b, not a.-b). The plan of a new server checks this; a rename is checked by the platform.
The provider asks for the name AT PLAN TIME whenever the configuration also names password or ssh_keys - a router needs neither, so such a configuration cannot be a router. A configuration with no name, no password and no keys is left to the platform: from here it is indistinguishable from a router, and the platform answers name_required itself.
networks(Set of Number) Private networks the server is attached to AT CREATION (no more than eight). Network cards of an existing server are a separate resource; they cannot be changed through this field, so editing it replaces the server.
The field IS NOT RECONCILED with state: the server record does not report private networks, and deriving them from the card list would report every card added by a separate resource as drift.
AT LEAST ONE NETWORK IS REQUIRED - this field, or public_ipv4, or both. The provider refuses a server with neither AT PLAN TIME; the platform refuses it too (network_required), because a server with no network card is unreachable.
The rules for a new server (this one, name, password and ssh_keys, the server type, image and plan) are checked whenever a plan creates a server - the new server of a replacement too - and again on apply before anything is ordered. A value known only during apply (an expression of a resource created in the same run) is checked only then, and in a replacement that is AFTER the old server is destroyed; the plan warns about it. The safe way is to apply the resource the value comes from first (terraform apply -target=...); create_before_destroy helps only when it is set on the server AND on every resource that takes server_id from it - see the guide "A project end to end". A plain terraform destroy plans the configuration first, and a server that is no longer in state (destroyed alone, or deleted outside Terraform) is planned as new: if a configuration without a network stops the destroy this way, run terraform destroy -refresh=false, or remove the server from the configuration.
password(String, Write-only) Administrator password inside the guest. Latin letters and digits, 12 to 64 characters, with an upper-case letter, a lower-case letter and a digit required, and without the wordAdministratorin any letter case (Windows refuses a password that contains the account name). The set is narrowed on purpose: the password is typed in the server console with a US keyboard layout.
A Windows server needs a password in any case: SSH keys do not work on Windows.
Set EITHER the password OR keys (ssh_keys, ssh_public_keys) - a server with neither is unreachable, and the platform rejects such a request (credentials_required). The provider asks for one of the two AT PLAN TIME whenever the configuration names name: a router is the only image that needs neither, and a router is not given a name either.
The field is WRITE-ONLY: the password goes neither into the plan nor into state (the state file keeps everything in clear text), and the public API does not return it. It is applied only at creation.
plan_id(Number) A ready-made plan. Only for server types that are sold as plans.
A plan change goes ONLY UP and ONLY on a stopped server - the provider stops it itself and starts it back if it was running. A change the platform refuses anyway (no such plan, a smaller one) is refused before the server is stopped. The platform cannot downgrade: to move to a smaller plan, the server has to be recreated.
public_ipv4(Attributes) Public address of the server. Exactly ONE of three forms: theidof an address you already hold,new = truefor a fresh one, orreuse = truefor one of your unused addresses. Omit the block entirely for a server with no public address.
WHAT HAPPENS TO THE ADDRESS WHEN THE SERVER IS DESTROYED depends on the form. new = true: the address was born with the server and goes back to the platform's shared pool when the server is destroyed (or replaced) - it is not billed any more, and it cannot be taken back; a replacement releases it before the new server is created, and the new server takes a free address from the shared pool, which may or may not be the same one - do not rely on keeping it (the plan warns about this for a change in the configuration, not for -replace or taint). id and reuse: the address stays with the project, billed, until you release it - with id it is usually a fiberax_ip resource that destroy releases itself, and on replacement it moves to the new server. With new = true the platform releases EVERY public address attached to the server at that moment, including one attached outside this configuration. An address reuse had to allocate new is kept just the same. Without the block (an imported server included) the addresses are kept as well. 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, whatever the form.
CHANGING THE FORM on an existing server replaces the server - a new one is created from the image and the disks of the old one are erased; removing the block does not replace anything. ADDING the block to a server Terraform created - without it, or after it was removed - is a change of form too and replaces the server. Only a server taken over with terraform import is different, and only until the first successful apply whose plan shows a change for it: a block written by then is recorded in state and replaces nothing. That apply ends the allowance even when its change only records values in state; an apply with no change for the server (a refresh, changes to other resources) does not. From then on adding the block replaces the server, and the plan shows it only as the usual "forces replacement".
A switch from new = true to reuse, or to id of the server's own address, is refused at plan time, because the replacement would release that address first. To keep such an address, remove the block (the address then stays with the project, still billed) and, to manage it, import it as a fiberax_ip and give the server depends_on on that resource, so that destroy deletes the server before releasing the address - the server is not replaced; the guide "Public addresses and what they cost" gives the steps. That dependency, like id = fiberax_ip.<name>.id, also makes terraform destroy -target=fiberax_ip.<name> delete the server with its disks: to release only the address later, first remove depends_on (or the block) and apply, then take the address off net0, the card the server was created with, outside Terraform - PATCH /v1/servers/{id}/network-interfaces/net0 with {"ips": []}, or the client area; a running server restarts once and is left without a public IPv4 address - and then remove the fiberax_ip from the configuration and apply; with no fiberax_ip for the address (a server with new = true) release it with DELETE /v1/ips/{id} - a fiberax_ip written without terraform import takes a NEW billed address. No resource manages net0 for taking addresses off it, and removing the block only changes state; the guide gives the steps. A switch from new = true to id of another address is planned with a warning: the old address goes back to the shared pool. From reuse or id to another form the old address stays with the project, billed, until you release it.
The provider refuses a block that names more than one form at plan time, even when the extra field is false (id = 5 together with new = false is refused). The platform itself only rejects a block where more than one form is TRUE; the provider is deliberately stricter so that the description reads as a single unambiguous choice. (see below for nested schema)
setup(Map of String, Write-only) Application settings for marketplace images. Which keys an image expects is listed with the image.
The field is WRITE-ONLY: the values go neither into the plan nor into state - some of them are application passwords, and the state file keeps everything in clear text. The platform does not return them either, and they are applied only at creation.
ssh_keys(Set of Number) Keys from the pool of the project's OWNER (GET /v1/ssh-keys) that are installed in the guest at creation. No more than twenty.
The field IS NOT RECONCILED with state: the server record does not report the installed keys. Keys can be added to an existing server with an API operation, but not with this field.
CHANGING THE LIST NEVER RECREATES THE SERVER and does not touch it: the new list is only recorded in state, and the plan says so with a warning. Keys removed from the list stay in the guest, and keys added to it are not installed - add them with POST /v1/servers/{id}/actions/add-ssh-keys, remove them inside the guest (~/.ssh/authorized_keys). The usual cause of such a change needs nothing at all: a fiberax_ssh_key renamed in the configuration, or deleted from the pool and created again, comes back with a new ID and the same material the guest already trusts.
ssh_public_keys(Set of String, Sensitive) Public keys AS TEXT that are installed in the guest at creation, one OpenSSH public key per element - the line of a.pubfile (ssh-ed25519 AAAA... user@host). Unlikessh_keysthey are NOT added to the key pool of the project's owner (GET /v1/ssh-keys), which every project of the account can list and delete from: use them for keys that must stay with one server, for example the keys of your own customers. Together withssh_keysno more than twenty. DSA keys (ssh-dss) are not accepted (the hypervisors run OpenSSH 10). The line must not contain control characters anywhere - a tab between the key and the comment too, so separate them with a space - nor line separators or U+FFFE/U+FFFF, and the comment must not contain:or a trailing:(cloud-init would read the key as a field name).
Sensitive: the plan does not print them. The server record does not return the text - it reports the installed keys as fingerprints only - so the field IS NOT RECONCILED with state, the same as ssh_keys.
CHANGING THE SET NEVER RECREATES THE SERVER and does not touch it: the new set is only recorded in state, and the plan says so with a warning. To add a key to a running server, call POST /v1/servers/{id}/actions/add-ssh-keys with ssh_public_keys; to give the server a new set of keys, reinstall it with POST /v1/servers/{id}/actions/rebuild and ssh_public_keys - the reinstalled system gets exactly the keys sent.
started(Boolean) Whether the server is powered on. The field has THREE VALUES:true- keep it on,false- keep it off, NOT SET - do not manage power at all.
The third value is load-bearing here, not a convenience: without it a run would silently power on a server you shut down yourself, and resume the charges for CPU and memory.
A server the platform is starting (status = "starting") reads as true, one it is stopping (stopping, shutdown) as false: the plan does not ask to power on a server that is already starting. If a start never completes (a platform task that did not run), the server keeps reading true while status stays starting, and Terraform does not start it again - check status.
tags(Set of String) Your own labels. Not set - the provider leaves labels alone; set - it brings their set to the one in the configuration. To remove every label, write an empty list.
No more than ten per server, counting the ones created in the client area. The platform compares labels CASE-INSENSITIVELY and rewrites the spelling of an existing one to match what you sent. Platform labels (those with hb-) are not shown and cannot be changed.
Because one label is kept and its spelling is rewritten, a configuration that lists TWO SPELLINGS of the same label (["prod", "Prod"]) can never converge: every apply would rewrite the spelling and the next plan would ask for the change again. The provider refuses such a configuration AT PLAN TIME, naming both spellings. Different labels that merely differ in case (LLM and gpu) are fine. A plain terraform destroy plans the configuration first and stops on this refusal too: fix the spelling, or destroy with terraform destroy -refresh=false.
timeouts(Block, Optional) (see below for nested schema)
Read-Only
admin_user(String) Administrator account name inside the guest, for examplerootorAdministrator.current_host(String) The host this server runs on right now, by its label. Null on server types that do not name their hosts, and while a server is still being built with no cards reserved yet.
OBSERVED, not declared: a move by an operator changes it, and Terraform does not move the server back. During a REINSTALL the platform moves the card marks to the new machine and the label reads empty for a while - the previous value is kept until the task is done.
gpu_cards(Attributes List) Graphics cards the platform reports on this server, grouped by model. Filled on both shapes: on a type where you pick the cards it repeatsgpus, on a type sold as a package it names the card of the package.
During a REINSTALL the platform moves the marks from the old machine to the new one, and in that window the list reads empty - the previous value is kept until the task is done. (see below for nested schema)
id(Number) Server ID. Stable identifier: use it in paths and to import the server.image_name(String) Human-readable name of the image the server was built from.ips(Attributes List) Public addresses attached to this server. (see below for nested schema)ipv4(String) Primary public address. Empty when the server has none.ipv6(String) Public IPv6 address.is_router(Boolean) A router. Renaming and resizing are refused on it.pending_reboot(Boolean) A change has been applied that the server needs a restart to pick up.server_type(String) Product name of the server type, for exampleCluster Server.status(String) Lifecycle status of the server. The set is closed - safe to branch on directly:running,stopped,paused,suspended,starting,stopping,shutdown,rebooting,resetting,reset,creating,rebuild,removing,resize,updating,backup,templating,migrated,rollback,pending_reboot,recovery,error,unknown.
unknown means the platform could not name the status, and is NOT an error; there is no need to recreate the server because of it.
Nested Schema for gpus
Required:
count(Number) How many cards of this model, 1 to 16.model(String) Model key, for examplel40s.
Nested Schema for public_ipv4
Optional:
id(Number) ID of an address the project already holds. The address must be free and belong to the pool serving the chosen server type.new(Boolean) Take a fresh address. It is billed while the server exists and goes back to the shared pool when the server is destroyed or replaced (a replaced server takes a free address from the shared pool, which may or may not be the same one).reuse(Boolean) Take one of YOUR unused addresses: the free address with the lowest id, from the pools of the server type you are creating on. IF NONE IS FREE, A NEW ADDRESS IS ALLOCATED AND BILLED - the same asnew = true. Which address was taken is visible inipsafter creation.
Nested Schema for timeouts
Optional:
create(String) A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).delete(String) A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs.update(String) A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
Nested Schema for gpu_cards
Read-Only:
count(Number)model(String)
Nested Schema for ips
Read-Only:
address(String)gateway(String)id(Number) ID of the address. Use it to release the address.netmask(String)prefix(String)primary(Boolean) True for the server's primary address.
Import
Import is supported using the following syntax:
The terraform import command can be used, for example:
# An existing server is imported by its ID. The ID is visible in the client area and in # the response of GET /v1/servers. terraform import fiberax_server.web 10851 # WHAT YOU HAVE TO WRITE BY HAND. The platform does not report back the server's private # networks, the installed SSH keys, the password, the licence acceptance or the setup # values - an imported server holds none of these in state. The provider does not invent # them: a configuration is meant to match reality, not to look as if it does. # # Adding such values to the configuration causes NO recreation: nothing to compare against.
Generated from the provider schema for version 0.11.0. How to install the provider: Terraform provider.