Prerequisites
- A service principal with an HCP Terraform federation trust. See set up federation if you haven’t created one yet. Use the HCP Terraform preset.
- The trust’s client ID (for example
clever-fox@yourcompany.conductor.one/wfe)
Step 1: Configure workspace environment variables
In your HCP Terraform workspace, set this environment variable:
HCP Terraform automatically generates a
TFC_WORKLOAD_IDENTITY_TOKEN environment variable for each run. This token is a signed JWT containing metadata about the Terraform run.
Step 2: Configure the provider
The C1 Terraform provider auto-detectsTFC_WORKLOAD_IDENTITY_TOKEN. You only need to provide the trust’s client ID:
terraform plan or terraform apply runs in HCP Terraform, the provider exchanges the workload identity token for a C1 access token automatically.
Explicit configuration
If you prefer to be explicit, or if you need multiple audience values, use a Terraform variable:TFC_WORKLOAD_IDENTITY_AUDIENCE_CONDUCTORONE in your workspace. HCP Terraform generates a corresponding TFC_WORKLOAD_IDENTITY_TOKEN_CONDUCTORONE variable.
Provider auth priority
The provider resolves authentication in this order:CONDUCTORONE_ACCESS_TOKENenvironment variable (static bearer token)oidc_tokenattribute, thenCONDUCTORONE_OIDC_TOKENenv var, thenTFC_WORKLOAD_IDENTITY_TOKENenv varclient_id+client_secretattributes orCONDUCTORONE_CLIENT_ID+CONDUCTORONE_CLIENT_SECRETenv vars