Skip to main content
phala_ssh_key manages SSH public keys at the account level in Phala Cloud. These keys can be referenced or injected into CVM deployments for SSH access.

Example Usage

You can also inline the key directly:

Required Attributes

Read-Only (Computed) Attributes

Behavior

Immutable Fields

Both name and public_key are immutable. If you change either one, Terraform destroys the old key and creates a new one. This mirrors the DigitalOcean SSH key pattern where keys are treated as immutable identities.

SSH Keys vs. ssh_authorized_keys

There are two ways to get SSH access into a CVM:
  1. phala_ssh_key resource — manages account-level keys in the Phala Cloud API. These persist across deployments.
  2. ssh_authorized_keys on phala_app — injects keys directly into a specific deployment at launch time. These are per-deployment and force-new.
You can use both approaches together. The ssh_authorized_keys attribute on phala_app accepts raw public key strings, not references to phala_ssh_key resources.

API Backing

The resource uses these Phala Cloud API endpoints:
  • POST /user/ssh-keys — create
  • GET /user/ssh-keys — read
  • DELETE /user/ssh-keys/{id} — delete