Skip to main content
Updated May 10, 2026 Registers an SSH public key for use when creating Linux VMs. The key string itself is immutable; rename in place. The detected algorithm is exposed as key_type.

Example — from a file

resource "raff_ssh_key" "alice" {
  name       = "alice@laptop"
  public_key = file("~/.ssh/id_ed25519.pub")
}

Example — inline

resource "raff_ssh_key" "ci" {
  name       = "ci-deploy"
  public_key = "ssh-ed25519 AAAAC3Nz... ci@deploy"
}

Argument reference

Required

ArgumentTypeDescription
namestringDisplay name. Updates rename in place
public_keystringFull SSH public key string. ForceNew

Attribute reference (computed)

AttributeDescription
idSSH key UUID
key_typeDetected algorithm — ed25519, rsa, etc.
created_at / updated_atRFC3339 timestamps

Lifecycle

OperationBehavior
terraform apply (create)Registers the key
Change nameIn-place rename
Change public_keyReplacement — destroy + recreate
terraform destroyDeletes the key from the registry. Existing VMs that already received the key keep it on disk

Importing existing keys

terraform import raff_ssh_key.alice <key-uuid>

Permissions

The API key needs ssh_key.create, ssh_key.manage, and ssh_key.delete at the account level. The system role Account Admin grants all of these.

Data sources

# Single key by UUID
data "raff_ssh_key" "alice" {
  id = raff_ssh_key.alice.id
}

# All keys, optionally filtered by name substring
data "raff_ssh_keys" "team" {
  name = "team-"
}

raff_vm

Reference key IDs in raff_vm.ssh_keys.

raff_api_key

API keys for programmatic access.

CLI: raff ssh-key

Imperative equivalent.
Last modified on May 11, 2026