Cost Monitoring Overview

Actual Cost

With cost monitoring enabled in env0 you will be able to see how much each Environment and Project you are running costs.

📘

Project Costs

To be able to see a project's costs you need to have the "Edit Project Settings" permission.

We utilize Terratag to automatically tag all of your cloud resources and determine exactly how much they cost over time.

Create cloud provider API credentials

In order to setup cost monitoring you will need to provide credentials that enable env0 to query your cloud provider's billing API. Below are guides for how to set up credentials in each cloud provider:

Enable cost monitoring

  1. Go to the Project Settings of the desired project.
  2. Select the Credentials tab.
  3. Check the appropriate cloud provider checkbox, and select the credential you created in the steps linked above.
  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.

Viewing Costs

Environment Costs

After enabling cost monitoring for a project, all subsequent environments under that project would be monitored.
To view an environment's cost, go to that environment's page, and click on the COST tab.

Project Costs

After enabling cost monitoring for a project, simply click Project Costs on the left side panel

Organization Costs

After enabling costs for projects, you can view all of them under Organization Costs.
To get to that Organization Costs page, click on the Dashboards in the bottom left, then click the COST tab

🚧

Project Based Calculation

Only projects with cost monitoring enabled would be counted.

Filter By Project

By default - the graph would display an accumulation of all project costs. You can filter by specific projects to view multiple projects' costs simultaneously. When chosen - each project's cost would be displayed separately.

📘

Project Filter

A greyed out project in the filter, means that project does not have cost monitoring configured

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 open source infracost tool to make the cost estimation.

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

Cost estimation in a self-hosted agent

Cost estimation is supported in self-hosted agents from 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.

You'll need to:

  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, and
  4. Create an INFRACOST_API_KEY secret environment variable in env0, referencing the API key stored in Secrets Manager

Disabling Cost Monitoring

Using the environment variable ENV0_ENABLE_COST_TAG=false, you can disable tagging per environment.