
Editor's note (2026): This 2021 comparison reflects Scalr's and Terraform Cloud's pricing at the time. Both have since changed — Scalr now uses run-based pricing (you pay per run, not per user, and the first 50 runs/month are free), and Terraform Cloud moved to a resources-under-management (RUM) model. The figures below are kept for historical context; see Scalr's current pricing for today's model.
According to DevOps.com, $6.6 billion were wasted on oversized cloud resources in 2020. The inability to quickly visualize the cost of deployment and the lack of guardrail implementation within organizations are some of the reasons why.
For teams that moved to infrastructure as code, and Terraform in particular, a few tools help head off that kind of waste. Terraform cost estimators calculate the cost of a deployment by calling the cloud provider's pricing APIs based on the Terraform templates they receive as input. The output is a breakdown of resource cost and how it changes compared to the current state. You can show it in pull request comments or CLI output, or feed it into a policy framework like Open Policy Agent or Sentinel.
In this article, we review the three main providers of cost estimation for Terraform: Infracost, Scalr and Terraform Cloud. We limited the scope of this guide to AWS, but these tools also have support for Google (Infracost, Scalr, Terraform Cloud) and Azure (Terraform Cloud). Please refer to their respective documentation (Infracost, Scalr, Terraform Cloud) to get an exhaustive view of the resources they support.
The goal is to help you decide which of these three providers fits your use case. We'll look at the setup process, the pricing, the resource coverage, the accuracy of the estimates, and how each one integrates with policy-as-code frameworks.
| Infracost | Scalr | Terraform Cloud | |
|---|---|---|---|
| Pricing (as of 2021) | Free | Free up to 5 users, $20/user/month starting 6 users (Scalr is now per-run) | $70/user/month |
| Installation | Binary | Integrated | Integrated |
| Policy As Code Framework Integration | None | Open Policy Agent | Sentinel |
Infracost
Infracost is free and open source. It must either be installed on your local machine (which is great for getting started or testing) or integrated into your CI/CD pipeline through GitHub Actions or Jenkins for example.
Scalr & Terraform Cloud
Scalr and Terraform Cloud differ from Infracost because they are not just cost estimation tools, but rather remote state & operations backends that offer a cost estimation feature. Scalr and Terraform Cloud provide features around automation and collaboration on Terraform. To estimate Terraform costs with Scalr & Terraform Cloud, you'll first need to estimate the number of runs you need and then go to the Scalr sign-up page to see your cost estimates.
Create a free Terraform Cloud account
Infracost
To run Infracost, just type the infracost command in the Terraform root directory. Infracost displays a detailed estimation of the monthly costs, broken down by resource. It also can post the results of the cost estimation to a pull request comment, where you'll be able to visualize the evolution of the cost based on the current state.


Scalr
Scalr automatically runs cost estimation during the plan and apply phases. It displays an estimation of the monthly costs as well as the evolution of the cost based on the previous state in the Scalr UI (for all runs) and in the CLI (for CLI-triggered runs).

Terraform Cloud
Like Scalr, Terraform Cloud displays an estimation of the monthly costs as well as the evolution of the cost based on the previous state on the UI and the CLI.

We ran a quick experiment to see how accurate the cost estimations were compared to the AWS reference price on three resources that all providers support. Both Infracost and Scalr predicted the same and correct cost, while Terraform Cloud always slightly underestimated it.
| us-west-2 | AWS Reference | Infracost | Scalr | Terraform Cloud |
|---|---|---|---|---|
| aws_db_instance 20 Go MySQL db.t2.micro | $14.71 | $14.71 | $14.71 | $14.46 |
| aws_instance ubuntu t3.micro | $8.39 | $8.39 | $8.39 | $7.48 |
| aws_ebs_volume 40 Go | $4 | $4 | $4 | $3.87 |
Letting developers see the cost of a deployment in the CLI or a pull request before running terraform apply is useful on its own. But you can go further: set guardrails that block a deployment automatically when it goes over a cost threshold. That's the job policy-as-code frameworks do.
Infracost has no integration with a policy as code framework, so you'll have to wire things up yourself to automatically enforce policy. Scalr integrates natively with Open Policy Agent, which is an open-source policy framework that works across the cloud-native stack. Here is an example of an OPA policy that checks if a cost estimate is above a certain threshold. Terraform Cloud integrates with Sentinel, Hashicorp's proprietary policy framework.
| Infracost | Scalr | Terraform Cloud |
|---|---|---|
| No | Open Policy Agent | Sentinel |
Infracost is a good place to start experimenting, especially if you already run a DIY Terraform pipeline and have no plan to move it to a remote state & operations backend. It had the best coverage for AWS resources, and it can comment on pull requests with the estimation results.
Scalr and Terraform Cloud work differently: cost estimation comes bundled into their remote operations backend, so you have to adopt them as your remote backend to use it. That can make sense if you're trying to standardize how your team uses Terraform and collaborate on it. The two mainly differ on pricing (at the time of writing, $20/user/month for Scalr if your team is larger than 6 vs. $70/user/month for Terraform Cloud; Scalr has since moved to run-based pricing and Terraform Cloud to a RUM model) and on the policy-as-code framework they support (Open Policy Agent for Scalr, Hashicorp's Sentinel for Terraform Cloud).
Either way, Terraform cost estimation is still a young area, and 2021 will probably bring a lot of improvement in the resources and cloud providers these tools support.
