Skip to content

Cost estimation

Terrateam can automatically provide cost estimates on each pull request that Terrateam runs a plan operation against. A comment will be placed alongside plan output showing the monthly spend change for the dirspace.


Cost estimation is configured in the .terrateam/config.yml file under the cost_estimation key. Here’s the default configuration:

enabled: true
provider: infracost
currency: USD


The enabled key is used to specify whether cost estimation is enabled or not.

enabledBooleanSpecifies whether cost estimation is enabled. Default is true.


The provider key is used to specify the cost estimation provider.

providerStringCost estimation provider. Default is infracost.


The currency key is used to specify the currency in which cost estimates are reported.

currencyStringAn ISO 4217 currency code to report results. Default is USD.



API key

If an Infracost API key is configured as a GitHub Actions Secret, then Terrateam will use the official Infracost public API endpoint. To set your Infracost API Key as a GitHub Actions Secret:

  1. Export your Terraform organization/repo combination as an environment variable. For example:
  1. Create the Infracost API Key GitHub Secret:
gh secret --repo "$REPO" set INFRACOST_API_KEY

Environment variables

Terrateam supports the following Infracost environment variables:

INFRACOST_API_KEYUser’s Infracost API key. Sign up and navigate to the Org Settings page to get your free Infracost API key.
INFRACOST_CURRENCYAn ISO 4217 currency code to report results. The value in the repository configuration takes precedence.


Enable cost estimation with default settings

enabled: true

This configuration will enable cost estimation using the default provider (Infracost) and currency (USD).

Disable cost estimation

enabled: false

This configuration will disable cost estimation.

Specify a different currency

enabled: true
currency: EUR

This configuration will enable cost estimation and report results in Euros (EUR).

We use cookies and similar technologies to provide certain features, enhance the user experience and deliver content that is relevant to your interests. Depending on their purpose, analysis and marketing cookies may be used in addition to technically necessary cookies. By clicking on "Agree and continue", you declare your consent to the use of the aforementioned cookies. Here you can make detailed settings or revoke your consent (in part if necessary) with effect for the future. For further information, please refer to our Privacy Policy .