Skip to main content

Readme badge

Add a cost badge in your repository files to enable engineers to see the repo's latest cost estimate quickly. This is specially useful for Terraform module repos where a central platform team creates re-usable modules for development teams, who are often unaware of the costs of those modules.

Cost badge


Cost badges require the cost estimate to be stored in Infracost Cloud so your repository file can fetch the badge from it.

  1. Follow the GitHub Apps integrations page to setup your repo in Infracost Cloud.

  2. In Infracost Cloud, go to Repos > Settings.

  3. Select the branch and project that the badge should represent. The branch should normally be your main or master branch, and you can select "All projects" if the badge should show a sum of all projects in the repository. For Terraform module repos, where there are no projects, use the "All projects" option.

    Readme badge code snippet

    The badge token is unique and associated with your Infracost Cloud organization. It only has access to the latest cost estimate for your repositories and nothing else, thus it is safe to be added to your files.

  4. Copy the Markdown or HTML code snippet and add it to the top of your file, commit and push your change to your repository.

    The cost badge will automatically show the latest cost estimate from your desired branch and projects.