Cost Estimation (Infracost Integration)

Cost Estimation

Cost estimation is a tool that can be used to help reviewers of deployment plans. Once activated for a project, every deployment plan would trigger a cost estimation calculation. This way, you can view a plan and its cost estimation, and decide whether or not to deploy this plan. Cost estimation is provided by Infracost.

🚧

Frameworks Support

Cost estimation is supported for deployments using Terraform, OpenTofu, or Terragrunt, including Terragrunt run-all deployments.

⏰

Temporary API key

For the first 30 days, env0 supplies an infracost API key so you can try out cost estimation feature. Please make sure to create your dedicated API key as soon as possible.

Set Up Infracost Integration

Infracost integration can be set for both SaaS and Self-hosted agents.

SaaS

  1. Create an API key for infracost - see infracost documentation.
  2. Go to organization variables and create an INFRACOST_API_KEY secret environment variable in env0

Self Hosted Agent

  1. Create an API key for infracost - see infracost documentation.
  2. Base64 encode the API key and deploy it with your agent configuration. See self-hosted agent documentation for more details, or
  3. Save that API key in your AWS Secrets Manager as plaintext, and
  4. Go to organization variables and create an INFRACOST_API_KEY secret environment variable in env0, referencing the API key stored in Secrets Manager

Enable Cost Estimation for your Project

To activatate cost estimation for your project, go to "Project Settings", and then to the "Policies" tab. Check the "Cost estimation" checkbox, and save.