Skip to main content

Add to CI/CD

Use one of our many integrations so DevOps, SRE and engineers see a cost estimate in pull requests before making changes. This provides your team with a safety net as people can understand cloud costs upfront, and discuss them as part of your workflow.



Screenshot of Infracost running in GitHub pull requests:

Infracost pull request comment

My CI/CD system isn't supported

Infracost can be used in any CI/CD system using the following steps. Our GitLab CI integration follows these steps and has many examples that you might find useful.

  1. Use one of the following options to add the Infracost CLI into your CI/CD:

    We maintain specific CI Docker images:

    infracost/infracost:ci-0.10 - Recommended, use latest 0.10.x version to pick up bug fixes and new resource costs
    infracost/infracost:ci-0.10.x - Lock the version, see versions in https://github.com/infracost/infracost/releases
    infracost/infracost:ci-latest - Use latest Infracost image, might break when new minor/major versions are released
  2. If your infra code is in GitHub, GitLab and Azure Repos or Bitbucket, run the breakdown and comment commands to generate a cost estimate and post a comment directly.

    Otherwise, run the breakdown and output commands to save the comment markdown (e.g. using --format github-comment) and post it from your CI/CD system using curl or other command line tools.

    You might also find the environment variables page useful.

If you run into any issues, please join our community Slack channel, we'll help you very quickly 😄