Hello, does Infracost support using the `TF_TOKEN`...
# help
k
Hello, does Infracost support using the
TF_TOKEN
environment variables? I'm running into case where it seems as it isn't respecting them.
l
Hi @kind-angle-62935 we don’t support
TF_TOKEN_
env vars, currently we just support a single token passed in via
INFRACOST_TERRAFORM_CLOUD_TOKEN
.
k
Hrm, i have a case where a customer has multiple domains that they pull private modules from and they using
TF_TOKEN
for the Terraform part. What do you recommend for them to be able to use Infracost? We're getting errors around getting 401 while pulling modules down (as expected)
l
As far as I remember we support
credentials
blocks in the
TF_CLI_CONFIG_FILE
, so if the tokens can be passed in that way I think it will work.
k
The documentation says:
• Modules from multiple registries: this could be supported by using the
TF_CLI_CONFIG_FILE
environment variable; contact hello@infracost.io so we can assist you.
Does that mean it actually does work or it could be made to work?
l
Looking at the code it seems like it should work out the box but I’m not sure we’ve really come across people using multiple registries: https://github.com/infracost/infracost/blob/061d5c3a5167d13ba247a8f4251ce09c9eb98acd/internal/credentials/terraform.go#L25-L34
k
Thank you!