secret attribute (sensitive). Anyone with read access to your Terraform state can use the key — store state in a backend with strict access controls (S3 + KMS, Terraform Cloud, etc.) and never commit terraform.tfstate to git.
Example — minimal
Example — full
Argument reference
Required
Optional
Attribute reference (computed)
Lifecycle
There is no managed re-fetch of
secret after create. If you lose the secret, the only recovery is to revoke and recreate the key. Note: the provider does not yet expose regenerate as a resource action — use raff api-key regenerate when rotation is needed.
Importing existing keys
secret will be empty in state — the API key works, but Terraform cannot supply the secret to a downstream provider. Use the CLI to rotate and capture the new secret.
Permissions
The API key managing other API keys needsapi_key.create, api_key.manage, and api_key.delete at the account level. The system role Account Admin grants all of these.
Data sources
Related
raff_role
Custom roles assigned to API keys via raff_member.
raff_member
Grant the key account-level access.
CLI: raff api-key
Imperative equivalent (incl. regenerate).