How to authenticate with Infisical from Terraform Cloud using OIDC.
Create a Machine Identity in Infisical
Enable Workload Identity Token Injection in Terraform Cloud
TFC_WORKLOAD_IDENTITY_AUDIENCE
:TFC_WORKLOAD_IDENTITY_AUDIENCE
my-infisical-audience
Important:Once set, Terraform Cloud will inject a workload identity token into the run environment as
- The presence of
TFC_WORKLOAD_IDENTITY_AUDIENCE
is required for Terraform Cloud to inject a token.- If you are self-hosting HCP Terraform agents, ensure they are v1.7.0 or above.
TFC_WORKLOAD_IDENTITY_TOKEN
.Configure the Infisical Provider
host
: Defaults to https://app.infisical.com
. Override if using a self-hosted Infisical instance.identity_id
: The OIDC identity ID from Infisical.token_environment_variable_name
: Must match the injected variable name from Terraform Cloud. If using single token, use TFC_WORKLOAD_IDENTITY_TOKEN
. If using multiple tokens, choose the one you want to use (e.g., TFC_WORKLOAD_IDENTITY_TOKEN_INFISICAL
).Validate Your Setup