Skip to content

Fast, open-source tool for estimating infrastructure costs from Terraform plans and state files

License

Notifications You must be signed in to change notification settings

terrateamio/openinfraquote

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

90 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

💸💰

OpenInfraQuote

Comedian, Chelsea Lately, faces the camera and says, "I am a bold artistic voice", with a brief pause before saying, "with a lot of credit card debt"

Infrastructure cost estimation from Terraform plans and state files

Stars Slack Latest Release OCaml License: MPL-2.0


OpenInfraQuote is a lightweight, open-source CLI tool for estimating infrastructure costs using Terraform plan and state files. It runs locally or in CI/CD. No backend, no API keys, no external services.

Built for teams that care about flexibility, privacy, and control.


Why OpenInfraQuote

  • 100% open-source (MPL-2.0)
  • No API keys or rate limits
  • Self-contained CLI, data does not leave your system
  • Works with your existing Terraform plans and state files
  • Easy to integrate into any CI/CD pipeline

Currently supports AWS. GCP and Azure are on the way.


Getting Started

You can install OpenInfraQuote by downloading the binary.

Download Pricing Sheet

Before running a cost estimate, download the latest pricing sheet:

curl -s https://oiq.terrateam.io/prices.csv.gz | gunzip > prices.csv

Install OpenInfraQuote

Download the latest release for your system:

  1. Go to the OpenInfraQuote releases page.

  2. Download the binary for your architecture.

  3. Unarchive and copy it to one of the directories in your $PATH, e.g. /usr/local/bin

  4. Confirm it’s working:

    oiq --help

GitHub Action for OpenInfraQuote

Automate your infrastructure cost estimates with OpenInfraQuote by adding the following step to your GitHub Actions workflow file:

- name: Run OpenInfraQuote
  uses: terrateamio/openinfraquote-action@v1
  with:
    plan-path: tfplan.json
    comment-on-pr: true

For more information, visit the OpenInfraQuote GitHub Action Marketplace page.

Examples

Estimate Costs from a Terraform Plan

terraform plan -out=tf.plan
terraform show -json tf.plan > tfplan.json
oiq match --pricesheet prices.csv tfplan.json | oiq price --region us-east-1

Example output:

Match date: 2025-03-25T20:26:25
Price date: 2025-03-25T20:26:25
Match query: region=us-east-1

Min Price: 61.78 USD
Max Price: 63.85 USD
Min Price Diff: 61.78 USD
Max Price Diff: 63.85 USD

Resources
  Name      Type            Min Price (USD)  Max Price (USD)  Change
  example   aws_s3_bucket   61.78            63.85             add

In JSON format:

oiq match --pricesheet prices.csv tfplan.json | oiq price --region us-east-1 --format=json

Estimate Current Costs from Terraform State

terraform state pull | terraform show --json > tfstate.json
oiq match --pricesheet prices.csv tfstate.json | oiq price --region us-east-1

Region and Usage Configuration

Region Handling

By default, OpenInfraQuote shows pricing across all regions. If you know which region to use, pass it explicitly with the --region flag. This is optional.

Plan and state files do not contain region information, so it must be provided manually if you want region-specific estimates.

Usage-Based Estimates

Some cloud resources are priced based on usage, such as storage size or number of requests. OpenInfraQuote includes default estimates for common usage patterns to help provide directional cost data. You can customize these assumptions by providing your own usage.json file.

See an example usage file here.


Running with Docker

To run OpenInfraQuote with Docker:

docker run --rm -i \
  -v $(pwd)/prices.csv:/prices.csv \
  -v $(pwd)/tfplan.json:/tfplan.json \
  ghcr.io/terrateamio/openinfraquote:latest \
  match --pricesheet /prices.csv /tfplan.json \
  | docker run --rm -i \
    ghcr.io/terrateamio/openinfraquote:latest \
    price --region us-east-1

FAQ

Is OpenInfraQuote 100% open-source?

Yes. There are no proprietary components or hidden features.

Which cloud providers are supported?

Currently AWS. GCP and Azure support is coming soon.

How accurate are the estimates?

Estimates are based on pricing data from official cloud provider APIs. OpenInfraQuote uses a pricing sheet (prices.csv) that is updated daily to reflect the latest public pricing. This file is downloaded and used locally, so your estimates stay current without needing a backend service.

Final costs depend on actual usage and any applicable discounts.

Where can I report issues or request features?

Open an issue on GitHub or join our Slack community.