HeadlinesBriefing favicon HeadlinesBriefing.com

New Terraform Provider Shows Cloud Costs in Plan

DEV Community •
×

Terraform users often face 'apply anxiety'—deploying infrastructure only to discover unexpected cloud bills months later. The traditional fix involves clunky external CLI tools that break workflow. A new Terraform Provider called plancost aims to solve this by integrating cost estimation directly into the standard `terraform plan` output.

Unlike wrapper scripts, plancost downloads with `terraform init` and stores cost data in the state file. It provides an instant diff, showing exactly how much a change—like downgrading an Azure Kubernetes Service (AKS) node pool—will cost before you apply it. This turns cost awareness into a native part of the infrastructure code.

The tool also enables 'Cost as Code' with guardrails. You can define policies directly in HCL to block deployments that exceed a budget or trigger warnings for cost spikes. Since it's a provider, it works seamlessly in existing CI/CD pipelines like GitHub Actions or Atlantis without managing extra binaries or API keys.