HCP Terraform (formerly Terraform Cloud) can issue workload identity tokens for each run. The C1 Terraform provider auto-detects these tokens, so your runs authenticate without stored secrets.Documentation Index
Fetch the complete documentation index at: https://conductorone-ian-account-to-user-pipeline.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
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:| Variable | Value |
|---|---|
TFC_WORKLOAD_IDENTITY_AUDIENCE | yourcompany.conductor.one (your C1 tenant domain) |
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
CEL expression examples
When creating the federation trust, the CEL expression controls which HCP Terraform runs can authenticate.Restrict to an organization and workspace
Restrict to apply phase only
Common HCP Terraform OIDC claims
| Claim | Example value | Description |
|---|---|---|
terraform_organization_name | acme | Terraform Cloud organization name |
terraform_workspace_name | infra-prod | Workspace name |
terraform_workspace_id | ws-abc123 | Workspace ID |
terraform_run_phase | apply | Run phase: plan or apply |
terraform_run_id | run-xyz789 | Unique run ID |
terraform_project_name | infrastructure | Project name |