Skip to main content
HCP Terraform gives each plan and each apply phase a workload identity token. Dodo Payments trusts this token through a terraform_cloud provider.

Provider Settings

Required Claims

The mapping must pin both terraform_organization_id and terraform_workspace_id. Pin terraform_run_phase to split plan and apply:
Create a second mapping with terraform_run_phase set to plan and read scopes only.

Workspace Configuration

In the workspace, add these environment variables: HCP Terraform then sets TFC_WORKLOAD_IDENTITY_TOKEN in each run phase.

Terraform Provider

The provider does one exchange at the start of each phase. Refer to Terraform.

SDK Usage

For code that runs in a Terraform run, for example an external data source, use the terraformCloud() helper:
The JWT of a phase can do one exchange only. Two processes that read the same TFC_WORKLOAD_IDENTITY_TOKEN cannot both do an exchange. The second exchange fails with the replay reason.
Last modified on October 28, 2026