Terraform provider reference / resources / ssh_key
fiberax_ssh_key (Resource)
An SSH key in your account pool.
The pool belongs to the account, not to a project. A token of any of your projects sees every key you have, adds to the same pool and may delete any of them - that is how the product is built, not a flaw in the isolation. In practice: two configurations driven by tokens of DIFFERENT projects of one account see the same pool and will fight over it. Keep your keys in a single configuration.
An added key is not rolled out anywhere by itself: it becomes available to pick when creating a server. Both fields change only through recreation - this resource has no update.
Example Usage
# An SSH key in your account pool.
#
# THE POOL BELONGS TO THE WHOLE ACCOUNT, not to a project: a token issued for any of
# your projects sees all your keys and may delete any of them. With several projects,
# keep the keys in ONE configuration - otherwise two configurations fight over one pool.
resource "fiberax_ssh_key" "deploy" {
name = "deploy@ci"
# A trailing newline in the .pub file does no harm: the platform stores the material
# trimmed, and the provider compares values by their substance, not byte by byte.
public_key = file("~/.ssh/id_ed25519.pub")
}
# A key is not deployed anywhere by itself - it becomes available to choose when a
# server is created.
resource "fiberax_server" "web" {
name = "web-01"
server_type_id = 4
image = "fcf9f69c8630904c1d6d73a821f4e674"
cores = 2
memory_mb = 2048
disk_gb = 20
ssh_keys = [fiberax_ssh_key.deploy.id]
public_ipv4 = { new = true }
}
Schema
Required
name(String) Your name for the key, unique within your pool. Letters of any language, digits, a space and. _ - @ : + ( ) /are allowed - clients usually paste the commentssh-keygenwrites here, in the formuser@host. No longer than 50 characters.
The platform cannot rename a key: changing this field recreates the resource.
public_key(String) The public key material, exactly as it appears in your.pubfile. The formsssh-rsa,ssh-ed25519,ssh-dssandecdsa-sha2-nistp256/384/521are accepted; the platform does not accept FIDO keys (sk-...) orssh-ed448.
This value is not a secret and is kept in state in the clear: the private half is not stored in the system at all.
Changing the material recreates the resource. Recreation goes in the order delete, then create: while the old key is still in the pool, its name is taken.
Read-Only
id(Number) ID of the key. This is the value you pick when creating a server.
Import
Import is supported using the following syntax:
The terraform import command can be used, for example:
# An existing key is imported by its ID. IDs are visible in the client area and in the # response of GET /v1/ssh-keys. terraform import fiberax_ssh_key.deploy 58
Generated from the provider schema for version 0.3.0. How to install the provider: Terraform provider.