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:

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

Optional

NOTE: Write-only arguments are supported in Terraform 1.11 and later.

The disk ONLY GROWS: the platform cannot shrink it, and a request for a smaller size is rejected.

Chosen at creation only: moving a system disk between storage classes is not an operation of the platform.

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.

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)

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.

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.

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.

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)

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.

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.

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.

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.

Read-Only

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)

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:

Nested Schema for public_ipv4

Optional:

Nested Schema for timeouts

Optional:

Nested Schema for gpu_cards

Read-Only:

Nested Schema for ips

Read-Only:

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.