Add a cost badge in your repository
README.md 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 badges require the cost estimate to be stored in Infracost Cloud so your repository
README.md file can fetch the badge from it.
Follow the GitHub Apps integrations page to setup your repo in Infracost Cloud.
In Infracost Cloud, go to Repos > Settings.
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.
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
Copy the Markdown or HTML code snippet and add it to the top of your
README.mdfile, commit and push your change to your repository.
The cost badge will automatically show the latest cost estimate from your desired branch and projects.