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
- Log into Terraform Cloud > go to Settings (top menu) > Run tasks (left menu) > Create run task (button top right).
- Log into Infracost Cloud > go to Integrations > Terraform Cloud > Enable.
- 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’.
- 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.
- 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.
- 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: