There are currently two methods of using Infracost with Terragrunt:

  1. For costs for a single Terragrunt directory you can run infracost with the TERRAFORM_BINARY environment variable set to terragrunt. For example:

    TERRAFORM_BINARY=terragrunt infracost --tfdir=/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 report command to combine multiple Infracost JSON files into a single table. For an example of a script that does this see scripts/terragrunt/report_all.sh.

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

We'd love to hear feedback from Terragrunt users, specially ones who'd like to use Infracost in CI/CD pipelines. Please join our community Slack channel or create an issue if there's anything we can help with.