Cost Estimation
Terrateam will 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.
Terrateam Configuration
Terrateam behavior can be configured via a config.yml
. This file is located in
a directory named .terrateam
at the root of your Terraform repository:
.terrateam/config.yml
.
See Configuration documentation for details.
Configuration
Top-level key: cost_estimation
See Configuration Reference documentation for details.
Key | Type | Description |
---|---|---|
enabled | Boolean | Specified whether cost estimation is enabled. |
provider | String | Cost estimation provider. |
currency | String | A ISO 4217 currency to report results. |
Default configuration:
cost_estimation:
enabled: true
provider: infracost
currency: USD
Providers
Infracost
The Infracost provider is served by the Infracost Cloud Pricing API.
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:
- Export your Terraform
organization/repo
combination as an environment variable.
For example:
export REPO="OWNER/REPO"
- Create the Infracost API Key GitHub Secret
gh secret --repo "$REPO" set INFRACOST_API_KEY
Environment Variables
Terrateam supports the following Infracost environment variables:
Name | Description |
---|---|
INFRACOST_API_KEY | User’s Infracost API key. Sign up and naviate to the Org Settings page to get your free Infracost API key. |
INFRACOST_CURRENCY | A ISO 4217 currency to report results. The value in the repository configuration takes precedence. |