Skip to content

terrateamio/openinfraquote-action

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 

OpenInfraQuote GitHub Action

Run OpenInfraQuote (oiq) on a Terraform plan file and post a cost estimate as a pull request comment.


Quick start

To use OpenInfraQuote in your GitHub Actions workflow:

  1. Ensure your Terraform plan file is written in JSON format:

    terraform init
    terraform plan -out=tfplan.binary
    terraform show -json tfplan.binary > tfplan.json
  2. Add the OpenInfraQuote GitHub Action as a step after the plan is generated:

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

If you're setting up a new workflow, here's a minimal example:

name: Terraform Plan

on:
  pull_request:
    paths:
      - '**.tf'
      - '**.tfvars'

permissions:
  pull-requests: write

jobs:
  plan:
    runs-on: ubuntu-latest

    steps:
      - name: Checkout repo
        uses: actions/checkout@v4

      - name: Set up Terraform
        uses: hashicorp/setup-terraform@v3

      - name: Terraform Init
        run: terraform init

      - name: Terraform Plan
        run: terraform plan -out=tfplan.binary

      - name: Convert plan to JSON
        run: terraform show -json tfplan.binary > tfplan.json

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

Inputs

Name Description Default
plan-path Path to the Terraform JSON plan file tfplan.json
comment-on-pr Whether to post a cost estimate as a comment on the PR true
region Optional region to pass to oiq price (e.g. us-east-1) (empty)

Output

When comment-on-pr is enabled and the estimate is non-zero, this action posts a PR comment that includes:

  • The estimated monthly cost range (min/max)
  • A table of resource-level cost changes

If the estimate is zero, no comment is posted.


Notes

  • This action processes a single Terraform plan file.
  • If you manage multiple plans (e.g., with a matrix), run the action once per plan.
  • Cost data is sourced from the public price sheet.
  • No API key or account is required.

License

MPL-2.0

About

No description, website, or topics provided.

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Packages

No packages published