Skip to main content

GitHub App

The Infracost GitHub App is an automated integration meaning that Infracost runs on our infrastructure and we keep it uptodate. The GitHub App is part of Infracost Cloud, our paid SaaS product. If you prefer a manual integration where you maintain Infracost, see GitHub Actions integration.

We are currently working on our SOC 2 Type II compliance process, see our security page for more details.

1. Install the Infracost GitHub App2. Get pull request comments
Install the GitHub App into any GitHub organizationInfracost automatically leaves a comment on every pull request

Usage

  1. Go to Infracost Cloud to sign up or log in to start your free trial (no credit card is needed).

  2. Every Infracost user has a default organization for personal use. Create a new organization for your company using the organization dropdown at the top of the page.

    Create new organization
  3. Click on Integrations > GitHub and follow the wizard to select the repos you want to give Infracost access to.

    • If you use private git modules, add your private SSH key (RSA format is recommended) so Infracost can clone the repos in the same way that Terraform does.
    • If you use private Terraform Registry modules, see this page.
    • Email hello@infracost.io if you use GitHub Enterprise (where you have a dedicated instance of GitHub).
  4. If you need to customize how Infracost runs, add an infracost.yml config file to the root of your repo. The GitHub App will automatically use that file if it's present. The app will also apply any usage values defined in the infracost-usage-yml usage file at the root of the repo.

  5. Open a test pull request and wait for Infracost to leave a pull request comment. The Infracost Cloud dashboard should also show the cost estimate too.

Pull request status

The Infracost GitHub App enables the dashboard to show you the status of pull requests so you can filter on them. You can also filter on the date range that the pull request was last updated, and the base branch that pull requests are being merged into (e.g. main, stage, production).

Create new organization
tip

If you don't use the GitHub App integration, use our API to set pull request statuses from your CI/CD system.

The pull request status can be:

  • open: the pull request is currently open, thus if you want to review the most expensive pull requests that are in-flight, only focus on these.
  • closed: the pull request was closed without being merged. These pull requests can probably be ignored altogether as most of the time they're just noise.
  • merged: the pull request was merged into the base branch, these can be checked when auditing actual cloud costs to see what happened.
  • deployed: the pull request was deployed. This usually happens after the pull request was merged. The GitHub App integration does not yet set the deployed status, so you can use our API to set it.

Migrating from GitHub Actions to GitHub App

We recommend enabling the GitHub App first, testing to ensure you're happy with it, then removing the Infracost GitHub Actions yaml configs from your repo.