Create an API key
Generate an API key in the Strettch Cloud console. Keep it somewhere safe — it acts with the same permissions as the member who created it.Provide the key
The recommended way is theSTRETTCH_CLOUD_API_KEY environment variable, so the key never lands in your configuration files:
main.tf
api_key argument, but only if the value comes from a variable or secret store — never a literal in version control:
In CI/CD
Store the key as a secret in your CI system and expose it asSTRETTCH_CLOUD_API_KEY for the plan/apply steps. For example, in GitHub Actions:
On HCP Terraform
SetSTRETTCH_CLOUD_API_KEY as a sensitive workspace environment variable. It is then write-only — it cannot be read back through the UI or API, and it is kept out of your configuration and state.
Log redaction is best-effort, not a guarantee. Verbose logging such as
TF_LOG=TRACE can print environment variables, so avoid it in shared or recorded runs.