There are currently two methods of using Infracost with Terragrunt:

  1. For costs for a single Terragrunt directory you can run Infracost with the INFRACOST_TERRAFORM_BINARY environment variable set to terragrunt as shown below. This can also be set in an Infracost config file.

    INFRACOST_TERRAFORM_BINARY=terragrunt infracost breakdown --path /path/to/code
  2. For aggregating costs across multiple Terragrunt directories, i.e. in cases where you would run terragrunt *-all, you can use the infracost output command to combine multiple Infracost JSON files into different formats. Use and customize the following scripts for this:

For CI/CD integrations, our Docker image (Dockerfile) has the latest stable versions of Terragrunt, see this section.