Once you've installed Infracost v0.8, follow this page to migrate to use the new features. Whilst we tried hard not to break old functionality by adding deprecation warnings, there is the risk of breakage as these improvements required significant code changes. Please report any issues and we'll address them as soon as possible.
v0.8.0 included major improvements to the CLI:
infracost diff command has been added to show a diff of monthly costs between the current and planned state. This was requested by many users as we already provided similar functionality in our CI/CD integrations, but it wasn't available in the CLI, and the CI output could be confusing. We've addressed both issues by adding this new command.
The dashes (-) have been replaced with price descriptions such as
Cost depends on usage: $0.20 per 1M requests so you can understand the pricing structure of usage-based resources such as AWS Lambda or Google Cloud Storage.
path flag has been introduced to replace the various methods of running Infracost. You can now simply point Infracost to the path of a Terraform directory, plan binary file, or plan JSON file and it'll just work. This lays some of the groundwork for supporting other IaC tools in the future 😉
The config file has been updated to support infra-as-code repos that have multiple workspaces and projects. This command combines the projects into the same breakdown or diff output. So if a Terraform module or variable is used across workspaces/projects, you can quickly see the cost impact of changing it.
infracost command has been deprecated as we've moved to using subcommands:
infracost breakdown: this works similarly to the previous
infracostroot command and shows a table breakdown of all resources by default. Run
infracost breakdown --helpto see the other options.
infracost diff: this shows a list of the resources along with costs that will change when the Terraform plan is applied.
The old root command will be fully removed in v0.9.0.
infracost report command has been deprecated and replaced with
This takes Infracost JSON files as inputs via
--path and allows them to be combined and outputted in any format using
--format json|diff|table|html. This command can be used with wildcards too, e.g.
infracost output --format html --path infracost*.json > output.html.
The following flags have all been deprecated and replaced with
-o flag has been replaced with
The following environment variables have been deprecated:
TERRAFORM_BINARY: replaced with
TERRAFORM_CLOUD_HOST: replaced with
TERRAFORM_CLOUD_TOKEN: replaced with
SKIP_UPDATE_CHECK: replaced with
The format of the config file has been simplified and a new version parameter has been introduced to enable safer iterations in the future. Initially the config file can be used for supporting repos that have multiple workspaces or projects. See the config file docs for details.
The following top-level keys in the old config format have been removed:
outputs. These can be set using flags (
--format / --show-skipped). If you were using multiple outputs you can use the
infracost output command to perform the same functionality, e.g.:
In the future we may add these keys back into the config format, but need to better handle edge cases when these are used in combination with flags and environment variables.
The JSON output from
infracost breakdown --format json has been changed to the following format:
The following top-level keys in the old JSON format are deprecated and will be removed in v0.9.0:
resourceSummary > unsupportedCounts key has been renamed to
summary > unsupportedResourceCounts.
Follow the relevant sections below to upgrade your CI/CD integration.
Switch your GitHub Action config to use our v0.6.0 GitHub Action. This supports the new
config parameters as mentioned above and in the GitHub Actions readme.
The GitHub Action outputs
current_branch_monthly_cost have been removed, and replaced with
Switch your CircleCI Orb to use our v0.6.0 Orb. This supports the new
config parameters as mentioned above and in the Orb readme.
Update your Bitbucket pipeline config to use the example in the latest Pipeline readme. This supports the new
config parameters as mentioned above.
Both Atlantis integration methods now run
infracost diff using the
$PLANFILE that Atlantis generates.
If you used the Docker image before, please update to the latest infracost-atlantis Docker image, or build your own image using the instructions mentioned here. The
terraform_plan_flags environment variable is no longer needed, so remove that from your Atlantis config.
If you used the Infracost API, no changes are needed as the API has been updated to return a diff.