Skip to content

Pre Deploy Cost Estimates from a Terraform Plan

The cheapest time to find out that a change costs 4000 a month is before you apply it. The Cost Estimate page prices a Terraform plan against AWS list prices and shows what your monthly bill looks like before and after.

Anyone in the organization can run an estimate.

Xplorr reads the JSON form of a Terraform plan:

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

Upload plan.json on the Cost Estimate page, or paste its contents, pick a default region, and click Estimate.

The plan is priced in memory and never stored.

  • Monthly change, the difference your plan makes, with how many changes could be priced
  • Before, the current monthly cost of the affected resources
  • After, the monthly cost once applied
  • Resource changes, one row per resource with its address, type, region, action and monthly cost, broken into components such as instance hours and storage
  • Not estimated, the resources Xplorr could not price and why

There is a Copy Markdown button that produces a summary suitable for pasting into a pull request.

This is the most important section on the page. Estimates cover a deliberately small set of resource types, all AWS.

Resource typeWhat is priced
aws_instanceInstance hours, plus root and extra EBS volumes
aws_ebs_volumeStorage per GB month, plus provisioned IOPS and throughput where they apply
aws_db_instanceInstance hours and storage, Single AZ or Multi AZ
aws_nat_gatewayHourly charge
aws_lb and aws_albHourly charge, for application, network and gateway load balancers
aws_elasticache_clusterNode hours multiplied by node count

aws_s3_bucket is reported as not estimated on purpose, because S3 cost depends on stored data, storage class and request volume, none of which a plan reveals.

Every other resource type, and every non AWS provider, is listed under Not estimated. Azure and GCP plans are not priced.

The totals cover priced resources only, so treat them as a floor rather than a full bill. Not included:

  • Data transfer and request charges
  • Load balancer capacity units
  • Aurora storage and I/O
  • RDS backup storage beyond the free allowance, and I/O
  • Anything driven by usage rather than by what the plan declares

Other assumptions worth knowing:

  • Prices are AWS on demand list prices in USD, at 730 hours per month. Your negotiated discounts, committed use and Savings Plans are not applied, so real cost is usually lower.
  • EC2 is priced as Linux on shared tenancy unless the plan says otherwise.
  • A root volume whose size comes from the AMI rather than the plan cannot be priced.
  • A resource whose instance type is not known until apply cannot be priced.

The per resource notes on the page call these out individually where they apply, so you can see which rows are affected.

The number that matters is monthly change, not the total. The estimate covers only the resources your plan touches, so the “before” figure is not your bill; it is the current cost of the things about to change.

Because discounts are not applied, a plan that looks affordable at list price will be affordable in practice. The reverse is not true: a plan that looks expensive might still be expensive after discounts.

The estimate endpoint can return its summary as markdown, which makes it straightforward to post the cost impact of a change as a pull request comment.

The Xplorr application repository carries an example GitHub Actions workflow showing the shape of this: generate the plan JSON, exchange an API token, call the estimate endpoint asking for markdown, and upsert a single comment on the pull request. It is an example to adapt rather than a supported action you can reference directly.

You will need an API token.

  • Up to 2000 resource changes per plan
  • Up to 5 MB of plan JSON
  • 30 requests per 15 minutes per user
  • Very large plans can exceed the request timeout. If that happens, split the plan or estimate a smaller target.

“Plan JSON must be the output of terraform show -json and include resource_changes”

You uploaded the plan file itself or a terraform plan transcript. Xplorr needs the JSON form produced by terraform show -json plan.out.

“That is not valid JSON”

The file was truncated, or the shell redirect captured other output. Regenerate it and check it starts with {.

“No priced resources”

The plan changes nothing Xplorr prices yet. Check the not estimated list to see what it found.

Rows say “No list price found”

Usually an instance type that does not exist in the chosen region, or a region mismatch. Confirm the region and the type.

The estimate looks far higher than my actual bill

Expected. List prices exclude your commitments and discounts. Compare against Commitments to see what you actually pay.

Is my plan stored? No. It is priced in memory and discarded.

Does this use my AWS credentials? No. Public list prices are used, so no access to your account is involved in pricing.

Does it support Azure or GCP? Not currently. Estimates cover the AWS resource types listed above.

Can I estimate an existing environment rather than a change? This prices a plan. For what you are spending now, use the cost pages.

Do I need to be an admin? No. Anyone in the organization can run an estimate.