Infracost uses a number of environment variables to customize various aspects of its behavior; these can be particularly useful in CI/CD integrations. Configuration values are chosen in this order:
- CLI flags (run
infracost --helpto see them)
- Environment variables
- Config file
Infracost API key, run
infracost register to get one.
Can be set to
warn in CI/CD systems to reduce noise, or
debug to troubleshoot. Turns off spinners in output.
true to skip the Infracost update check; can be useful in CI/CD systems. We regularly add support for new resources so we recommend watching our repo for releases: goto the repo page, click on the Watch button > select Custom > Releases and click on Apply. Be sure to upgrade regularly.
Used to change the path to the
terraform binary, e.g.:
terraform(default, latest stable version of terraform)
terraform_0.14(latest patch version of 0.14)
terraform_0.13(latest patch version of 0.13)
terraform_0.12(latest patch version of 0.12)
terragrunt(latest patch version of 0.28, if you need other versions of Terragrunt in the Docker image, please create an issue)
Infracost works with Terraform v0.12 and above.
Used to set the Terraform workspace (this sets the
TF_WORKSPACE internally). The
--terraform-workspace flag can also be used.
Only set this for multi-workspace deployments, otherwise it might result in the Terraform error "workspaces not supported". If you see this error, try running
unset INFRACOST_TERRAFORM_WORKSPACE and
For Terraform Cloud/Enterprise users, set this to a Team API Token or User API Token so Infracost can use it to access the plan.
For Terraform Enterprise users, used to override the default
app.terraform.io backend host.
false to opt-out of telemetry when using a self-hosted Cloud Pricing API.
Standard Terraform environment variables such as
TF_CLI_CONFIG_FILE can also be added if required, for example: