Use of TF_TOKEN_ Environment Variable for External Module Registry Access #626
-
According to Terraform CLI documentation, version v1.2.0 and later support use of environment variable credentials to make requests to specific hostnames (https://developer.hashicorp.com/terraform/cli/config/config-file#environment-variable-credentials). We're hoping to migrate all of our workspaces from Terraform Cloud into Terrakube and it would be significantly easier if we had a way to pull modules from our current Terraform Cloud module registry while we convert to either a Terrakube registry or update our modules to use Github repo sources. Should this work by simply setting an environment variable named
I have used a modified template to print the environment variables in my Terrakube shell environment and can see the appropriate variable for |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
I never used the TF_TOKEN_app_terraform_io environment variable but if you add it to the workspace or as a global variable it will be injected when the job is running. In the end Terrakube is just running the Terraform CLI and injecting the environment variables in a new process inside the container, which terraform version are you using? did you try running the plan/apply just with the terraform CLI to check if TF_TOKEN_app_terraform_io works correctly locally? |
Beta Was this translation helpful? Give feedback.
I have created #631 to fix this issue.