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 a separate billable resource. It OUTLIVES the server, and you
# keep paying for it until you release it.
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)
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.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.
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. The set is narrowed on purpose: the password is typed in the server console with a US keyboard layout.
Set EITHER the password OR ssh_keys - a server with neither is unreachable, and the platform rejects such a request.
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. 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.
The address is a STANDALONE billed resource: it outlives the server and keeps being 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.
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.
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.
timeouts(Block, Optional) (see below for nested schema)
Read-Only
admin_user(String) Administrator account name inside the guest, for examplerootorAdministrator.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.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 and stays with the project after the server is deleted.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.3.0. How to install the provider: Terraform provider.