We released Infracost v0.9.12 recently, you can upgrade to use these features. This release includes many bug fixes and we have made Infracost a lot faster to run!
Improved CLI output
We’ve simplified the output for AWS S3 and CloudFront. Previously these resources had over 50 lines of output due to their complicated pricing models. We now only output their standard pricing options; other prices are shown when applicable parameters are used in a usage file.
Furthermore, when a new usage file is generated, values are commented-out unless a value is fetched from AWS CloudWatch. This enables you to uncomment required usage-based parameters. Also, cost components with zero usage are hidden in the table and HTML output to simplify the output.
The diff output now groups projects with no usage diffs into one line, which can simplify the output for Terraform mono repos and Terragrunt projects.
The JSON output now includes 4 new fields: the hourly/monthly total cost of all diffs and past totals. This is useful when Infracost is used with other tools such as pre-commit-terraform.
Faster CLI runs
To speed-up CLI runs, we now cache Terraform plans where possible. This is helpful when the CLI is re-run to do what-if analysis with the usage file or show skipped resources. Caching only happens when the CLI is being used outside of CI/CD integrations and a new
--no-cache flag has been added to disable this behavior where required.
The fetch from CloudWatch feature has been expanded to fetch usage data for S3, AutoScaling and EKS node groups. A new CI/CD parameter,
sync_usage_file=true, has been added so this can also be triggered in CI/CD runs.
Infracost config files now support a new
env parameter that can be used to define environment variables for each project as shown in the following example. The config file syntax is also validated and more helpful error messages are shown. We recommend users add an
infracost.yml config file to their projects as well as any usage files to their repos so
infracost breakdown --config-file infracost.yml can be run by anyone without having to type all the flags/envs.
- path: dev
- path: prod
We have added support for the following resources:
The community has been writing some awesome content around Infracost, and I’d like to give them a shout-out here:
- Florian Pialoux wrote a blog on how to integrate Infracost with Terraform Cloud.
- Anton Babenko, Maxym Vlasov and George Yermulnik added support for Infracost to pre-commit-terraform, checkout the docs for useful tips.
- Alex McFarland wrote a step by step guide on Infracost.