Introducing OpenInfraQuote: An Open-Source Terraform Cost Estimation Tool
OpenInfraQuote is a brand-new lightweight, open-source CLI tool for estimating infrastructure costs based upon Terraform plan and state files that can run locally or in CI/CD with no backend, API keys or external integration required.

Introduction
As organizations use Infrastructure as Code (IaC) to automate and speed up cloud deployments, it’s easy to overlook the cost of each resource—especially in fast environments with services created quickly across cloud providers. Each IaC change can lead to new or higher costs, and teams often see unexpected bills later. This is where a cost estimation tool becomes critical—it shows expected cloud costs before changes are made, helping teams make informed choices, avoid budget issues, and add cost checks into their development process.
OpenInfraQuote is an open-source CLI tool that reads Terraform plan and state files to estimate cloud infrastructure costs. Created by TerraTeam, with contributions from LocalStack, it adds cost visibility to GitOps or structured workflows. While other tools exist, most are only partly open-source or part of commercial products. OpenInfraQuote is different—it is fully open source and licensed under the Mozilla Public License (MPL).
The tool is intentionally minimal in scope. It doesn’t handle RBAC, policy management, or apply logic. Its only job is to estimate pricing. This focus keeps it simple and maintainable. Here’s how you can use OpenInfraQuote with LocalStack to see a cost breakdown of a sample Terraform configuration before deploying it.
How it works?
The cost-estimation process involves three main inputs:
- Terraform Plan/State (in JSON format) – These describe what you’re deploying.
- Pricing Sheet (
prices.csv
) – A file that maps Terraform resources to pricing data. - Usage File (
usage.json
) – Optional file where you can define usage assumptions, such as request counts for an S3 bucket. This is pre-built into the CLI tool.
The output is a monthly cost estimate for the plan or state file, available in text or JSON format. The CLI tool basically follows a two-step process to calculate this:
- Matching: Resources from plan/state files are matched against a price sheet (CSV file).
- Pricing: Matched resources are then priced based on usage patterns and specified parameters.
This separation of concerns makes the tool flexible. For example, if your region isn’t defined in the Terraform files, the tool will default to giving you a min-max price range based on all possible regions. But if you specify a region during pricing, the range will narrow, giving you a more accurate estimate.
How to use it?
Here’s a quick demo showing how to use OpenInfraQuote. We’ll use LocalStack’s tflocal
with a sample Terraform configuration and run OpenInfraQuote to generate a monthly cost summary. The tool gives a detailed breakdown by resource, showing each resource’s name, type, cost range, and whether it was added, changed, or deleted.
Install OpenInfraQuote
To install OpenInfraQuote, head over to the GitHub Releases page of the terrateamio/openinfraquote
repository. At the time of writing this blog, the latest version is v1.10.0
, so we are going to install that.
First, download the binary & extract the archive:
curl -LO https://github.com/terrateamio/openinfraquote/releases/download/v1.10.0/oiq-darwin-amd64-v1.10.0.tar.gztar -xzf oiq-darwin-amd64-v1.10.0.tar.gz
Now, move the binary to a directory in your $PATH
(e.g., /usr/local/bin
), and make sure its executable:
sudo mv oiq /usr/local/bin/sudo chmod +x /usr/local/bin/oiq
You can now verify the installation:
oiq --help
Download the repository
First, clone the repository that contains the sample Terraform configuration. This configuration deploys an API Gateway that manages sample data using Lambda functions, which connect to an RDS PostgreSQL database through RDS Proxy.
git clone https://github.com/localstack-samples/rds-proxy-terraform-sample
After cloning the repository, navigate to the terraform
directory, which contains the Terraform configuration files. Then, initialize the project using tflocal
:
cd terraformtflocal init
Create a Terraform plan
Next, create a Terraform plan file using the following command:
tflocal plan -out=plan
This generates a plan file based on the Terraform configuration. Since this is running locally with LocalStack, the plan is created quickly. Convert the plan to a JSON file using:
tflocal show -json plan > plan.json
OpenInfraQuote uses the JSON output from Terraform plan and state files to ensure stability and consistency in cost estimates.
Estimate the costs
Before running the cost estimation, download the latest pricing sheet using the command below:
curl -s https://oiq.terrateam.io/prices.csv.gz | gunzip > prices.csv
Now, run the cost estimation with the OpenInfraQuote CLI:
oiq match --pricesheet prices.csv plan.json | oiq price --region us-east-1
This will generate output similar to the following:
Match date: 2025-04-04T10:07:47Price date: 2025-04-04T10:07:47Match query: not region or (region=us-east-1)Min Previous Price: 0.00 USDMax Previous Price: 0.00 USDMin Price: 100.00 USDMax Price: 100.00 USDMin Price Diff: 100.00 USDMax Price Diff: 100.00 USDResources Name Type Min Price (USD) Max Price (USD) Change db-setup aws_lambda_function 20.00 20.00 add delete_dog aws_lambda_function 20.00 20.00 add get_dog aws_lambda_function 20.00 20.00 add post_dog aws_lambda_function 20.00 20.00 add put_dog aws_lambda_function 20.00 20.00 add
The output shows a detailed breakdown for each resource, including the resource name, type, estimated cost range, and whether it was added, changed, or deleted.
In this example, the estimated monthly cost is $100. Since the plan includes only new resources, the difference between the previous and current cost equals the total cost. If changes were made to an existing setup, only the cost of those changes would be reflected.
To get the same output in JSON format, you can run:
oiq match --pricesheet prices.csv plan.json | oiq price --region us-east-1 --format json
This output can be used with tools like Open Policy Agent (OPA) to enforce cost-related policies, such as setting monthly budget limits or restricting specific resource types.
Current Support
OpenInfraQuote currently supports AWS, but full service coverage is still in progress. The roadmap includes future support for GCP, Azure, and any cloud provider with a Terraform provider and an accessible pricing model.
The CLI is open source, and contributions are welcome. You can help in the following ways:
- Run
match
on your plan or state files and share the JSON output (after removing any sensitive data). - Submit resource mappings for services that are not yet covered.
- Report bugs and request features to help improve the tool.
Conclusion
OpenInfraQuote is a CLI-first tool designed to be simple and easy to use. There are no API keys to manage, no servers to run, and no data ever leaves your machine. It works with any Terraform wrapper—OpenTofu or Terragrunt—as long as you have access to the plan or state files. Adding support for new resources is as simple as updating a CSV pricing sheet.
Its lightweight and fast design makes it ideal for privacy-focused teams and fast local development. With LocalStack, generating plan and state files for testing is quick and cost-free, making it easy to integrate cost estimation into your workflow.
Together, OpenInfraQuote and LocalStack help teams build, test, and optimize cloud infrastructure with more confidence and control. Want to see it in action? Watch the video below!