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
Required Attributes
Read-Only (Computed) Attributes
Behavior
Immutable Fields
Bothname 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:phala_ssh_keyresource — manages account-level keys in the Phala Cloud API. These persist across deployments.ssh_authorized_keysonphala_app— injects keys directly into a specific deployment at launch time. These are per-deployment and force-new.
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— createGET /user/ssh-keys— readDELETE /user/ssh-keys/{id}— delete
Related
- phala_app Resource — deploying apps with SSH access
- Examples — SSH access patterns

