CloudCostCompare
FR

Cette page n’est pas encore disponible en Français, le texte ci-dessous est donc en anglais. Ouvrir la page en anglais

Guides

Price a Terraform plan before you apply it

Par Rohit Athaide · Publié le 3 nov. 2026

Infrastructure code tells you what will be created. It does not tell you what it will cost. The Terraform plan estimator closes part of that gap: give it the JSON of a plan and it prices the resources it can, and lists the ones it cannot.

Create the file

Terraform can write a plan to a file and then show it as JSON:

terraform plan -out plan.out
terraform show -json plan.out > plan.json

Open the estimator and choose the file, or paste its contents. The file is read in your browser and is never uploaded. The page only downloads the public price catalog, and you can confirm that in your browser’s network panel.

A plan file can contain sensitive values. Because it stays in your browser, that is safe here, but treat the file itself like any other secret and do not commit it.

What it prices today

  • EC2 instances (aws_instance): the instance type, as Linux on shared tenancy at on-demand rates, plus the root and attached volumes where the plan gives their size and type.
  • EBS volumes (aws_ebs_volume): by size and type. If the plan does not state a type, the provider’s documented default, gp2, is assumed, and the line says so.
  • RDS for PostgreSQL (aws_db_instance): the instance class and the allocated storage, at Single-AZ or Multi-AZ prices depending on the plan.

Resources inside modules are included. Data sources, which cost nothing, are skipped.

What it lists as not priced

Everything else. Each one appears in a table with a reason, left out of the total.

  • S3, Lambda, DynamoDB and similar, because their cost depends on usage that a plan cannot state.
  • Load balancers and NAT gateways, which are not in the catalog yet.
  • Other database engines.
  • Instances with an unknown type or size, which Terraform only knows after apply.
  • Resources from other clouds, since only AWS is in the catalog.

Reading the result

The total is marked partial whenever anything is not priced, and the page says it is a lower bound: the real cost is at least that, plus what was left out. It is deliberately not compared with any other cloud, because an incomplete total must not be called the cheapest.

Each priced line shows its working, for example the hourly price times the quantity times 730 hours, and links to the vendor’s price list with the date it was read. The assumptions are listed at the bottom:

  • on-demand list prices, one 730-hour month, no discounts, reservations, spot or tax;
  • Linux on shared tenancy, since a plan does not say what runs on a server;
  • volumes and database storage by capacity only, without provisioned performance, snapshots, backups or data transfer;
  • no usage-based charges.

Region

The page uses the region in the plan’s provider configuration when the catalog covers it, which today means US East (us-east-1) and Mumbai (ap-south-1). If the plan does not say, or names another region, you choose a group and the page tells you which it used.

A good use of it

Run it on every proposed change, and compare the total before and after. A plan that adds ten large instances shows its cost before you approve it. You can also paste the output into a review, with the unpriced resources listed so nobody assumes they were free.

Limits to keep in mind

It is an aid for catching large mistakes, not a billing forecast. For the practice of comparing estimates with bills, see how to read a cloud cost estimate. The data behind it is the price catalog, explained in how to use the price catalog. For the database choice that this plan might include, see managed database or self-hosted.