HashiCorp Terraform Cost Estimation With Infracost And Run Tasks Now GA

Today, I’m super excited to announce, alongside our partner HashiCorp, that we have launched a direct integration into Terraform Cloud using the new Terraform run tasks feature.

We started Infracost to show engineers how their Infrastructure as Code changes will impact cloud costs before anything goes to production. It felt unfair not to have a ‘checkout screen’ for developers because when budgets were breached, they would not only be blamed but also be tasked with bringing costs down (again, with no indication of whether their changes are having the right cost impact).

We didn’t want to create something that would slow engineers down. They want to ship great and efficient products fast. So we brought costs directly into the workflow by integrating into CI/CD systems. Infracost now leaves a comment like ‘this change will increase your costs by 15% next month’ with a detailed breakdown.

Today, I’m super excited to announce, alongside our partner HashiCorp, that we have launched a direct integration into Terraform Cloud using the new Terraform run tasks feature. If you are using Terraform Cloud, you can show everyone a cost estimate of the infrastructure changes without leaving the TFC dashboard. The setup takes 3 minutes.

The 3 minute setup – start here

  1. Log into Terraform Cloud > go to Settings (top menu) > Run tasks (left menu) > Create run task (button top right).
  1. Log into Infracost Cloud > go to Integrations > Terraform Cloud > Enable.
  1. Enter the Endpoint URL and the HMAC key from step 2 into Terraform Cloud (step 1). Give the Run Task a name like ‘Infracost cost estimation’.
  2. Now we need to add a Run Task to a Workspace in Terraform Cloud, so go to Workspaces (top menu) > select your workspace > Settings > Run Tasks, and click the (+) button next to the ‘Infracost cost estimation’ Run Task that you just created.
  1. Select ‘Advisory’ as the enforcement level – this means that the cost estimation does not block a run from competing. Infracost does not yet support Mandatory enforcement in which a run can be blocked due to increased costs, but this will be a feature in the future.
  2. Click Create. That’s it. You are now showing everyone how the TF code changes will impact cloud costs. You can now add Infracost to as many workspaces as you like.

You can get up and running with Terraform Run Tasks and Infracost within a few minutes. Here is a live walkthrough of Terraform Run Tasks with Infracost:

Similar Posts