Cost Monitoring Overview

Actual Cost

With cost monitoring enabled in env0, you will be able to see how much each Environment you are running costs.
We utilize Terratag in order to automatically tag all of your cloud resources to be able to determine exactly how much you cloud resources costs over time.

Create Cloud Provider API Credentials

In order to setup cost monitoring, you will need to provide credentials that permit env0 to query your cloud providers billing API. Below are guides for each cloud provider and how to set up your credentials.

Enable Cost Monitoring on Your Project(s)

  1. Go to the Project Settings of the desired project
  2. Select the Costs Tab
  3. Check the appropriate cloud provider checkbox, and select the credential you added in the previous step.
  4. Click Save

Accuracy and incurred costs

  • env0 tags resources in your Terraform, in order to query your cloud provider for the actual costs. You can see which tags are applied in the Terraform plan. Some resources might not be tagged, in which case the cost reported on env0 will be lower than expected.
  • env0 will call your cloud provider's API in order to query the cost. This might incur additional charges from your cloud provider.

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.

We are using the infracost open-source in order to make the cost estimation

In order to activate cost estimation for your project, go to "Project Settings", and then to the "Policies" tab. There, check the "Cost estimation" checkbox, and save.

Cost Estimation in a Self-Hosted Agent

Cost estimation is supported in self-hosted agents of version 0.2.82+. In order to activate cost estimation in a self-hosted agent, you'll need to create your own secret API KEY for infracost in order to use cost estimation.

In order to do so, you'll need to:

  1. Create an API key for infracost - see infracost docs on how to do so
  2. Save that API key in your AWS Secrets Manager
  3. Create an INFRACOST_API_KEY secret environment variable in env0 referencing the API key stored in Secrets Manager

Did this page help you?