Skip to main content
The provider authenticates with a Strettch Cloud API key, sent as a bearer token on every request.

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 the STRETTCH_CLOUD_API_KEY environment variable, so the key never lands in your configuration files:
main.tf
Typing the key as an argument records it in your shell history. To avoid that, read it interactively instead:
You can set it inline with the api_key argument, but only if the value comes from a variable or secret store — never a literal in version control:
A saved plan (terraform plan -out=...) stores input variable values in cleartext, even when marked sensitive. Anyone who can read the plan file can recover the key — so prefer the environment variable for automation, and protect any plan artifacts you keep.
Never commit your API key. Treat it like a password: use an environment variable or a secrets manager, and rotate it if it is ever exposed.

In CI/CD

Store the key as a secret in your CI system and expose it as STRETTCH_CLOUD_API_KEY for the plan/apply steps. For example, in GitHub Actions:

On HCP Terraform

Set STRETTCH_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.