Generate reports
The infracost breakdown
command has a --format json|table|html
flag that can be used to change the output format. The JSON option can be used to generate files from individual projects that can then be consumed by the infracost output
command to generate a combined report. The output command has a --format json|diff|table|html
flag that sets the report format.
These reports can be uploaded to object storage such as AWS S3 or Google Cloud Storage and shared with others including team members or management. The HTML report also includes the file names and Terraform tags from the files that were used to generate it.
Usage#
Run infracost output --help
to see the available options. Example usage:
Examples#
- Example HTML report
- JSON format
- Table format
- Diff format

Tip: You can use jq
to extract values. For example, to see the total monthly cost increase of a project you can use:
Here is an example of the full JSON output:
Bulk run#
The following bash scripts run Infracost on all subfolders that have .tf
files and output the combined results using the infracost output
command. You can customize them based on which folders they should exclude or how you run Infracost (e.g. pass --terraform-plan-flags
).
- to run
infracost breakdown
, use breakdown_all.sh - to run
infracost diff
, use diff_all.sh