Problem
A workspace configured to use dynamic credentials with multiple provider configurations fails with an error message similar to the following.
Error: No value for required variable
on main.tf line 24:
24: variable "tfc_vault_backed_aws_dynamic_credentials" {
The root module input variable "tfc_vault_backed_aws_dynamic_credentials"
is not set, and has no default value. Use a -var or -var-file command line
argument to provide a value for this variable.
Operation failed: failed running terraform plan (exit 1)Note: The error message may vary depending on the provider and credential type you use.
Cause
This error can occur for several reasons:
- Your version of Terraform Enterprise does not support dynamic credentials with multiple provider configurations. This feature was added in Terraform Enterprise
v202308-1. - You are using a self-hosted HCP Terraform agent on a version that does not support this feature. Support was added in agent version
v1.12.0. - The workspace's environment variables for dynamic credentials are not configured correctly.
Solutions
Solution 1: Upgrade Terraform Enterprise
If your workspace is on a Terraform Enterprise version older than v202308-1, contact your platform administration team to request an upgrade to a supported version.
Solution 2: Upgrade the HCP Terraform Agent
If you use self-hosted HCP Terraform agents, ensure they are version v1.12.0 or newer. Contact your platform administration team to request an agent upgrade if necessary.
Solution 3: Verify Workspace Environment Variables
If you are on a supported version of Terraform Enterprise and the agent, review the required environment variables in the dynamic provider credentials documentation and add any missing variables to your workspace.