Create a Raff API key with Terraform. The plaintext secret is returned ONCE on create and stored in the secret attribute (sensitive). Lock down your Terraform state.
Updated May 10, 2026Creates a Raff API key. The plaintext secret is returned once on create and stored in the 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.
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.
After import, 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.
The API key managing other API keys needs api_key.create, api_key.manage, and api_key.delete at the account level. The system role Account Admin grants all of these.