Releases: infracost/infracost
v0.10.8
0.10.8 (July 20 2022)
Infracost v0.10.8 adds support for Infracost Cloud, our new hosted service. 🎉 🎉 🚢
It enables team leads, managers and FinOps practitioners to have visibility across all cost estimates in CI/CD and answer questions like:
- What are the top pull requests that will increase/decrease costs the most? Who is working on them?
- What were all the pull requests to the main branch on the date we had a spike in cloud costs?
As part of this, we've removed the infracost register
command in favour of infracost auth login
, which uses our new login flow. This will not impact existing users or existing API keys.
This release also contains several critical bug fixes for the CLI that have arisen from Infracost's VSCode extension support.
New features
- AWS, Azure & GCP VMs now support a
monthly_hrs
usage field - by @jessecureton in #1812 - Bitbucket output/commend commands now include a
--exclude-cli-output
option. Allowing users to truncate long Bitbucket comments - by @vdmgolub in #1881 - Structured logging support. All Infracost commands now have a
--debug-report
flag, which generates a rich JSON debugging report. This helps Infracost maintainers debug problems quickly - @hugorut in #1808
Azure
- IoT Hub support - by @sawyerw-mastery in #1850
- Virtual Network peering support - by @sawyerw-mastery in #1852
Fixes
-
Updated path variables for Terraform file functions. This fixes problems with users trying to load files in child modules - by @tim775 in #1849
-
Tweaked product filters for Google Storage Bucket - by @vdmgolub in #1868
-
Better automatic project name detection - by @hugorut in #1878
-
Several panic and runtime errors caused by incomplete VSCode Terraform files
- Parser index panic - by @aliscott in #1861
- Azure VM scale set panic when resource has no
storage_profile_os_disk
block - by @aliscott in #1864 - Entry in nil map panic - by @aliscott in #1865
- Use a safer methods for type conversion - by @hugorut in #1866
- Remove providing
cty.NilVal
to HCL expressions when in a partial evaluation state - by @hugorut in #1867
New Contributors
- @jessecureton made their first contribution in #1812
- @sawyerw-mastery made their first contribution in #1850
Full Changelog: v0.10.7...v0.10.8
v0.10.7
0.10.7 (July 08 2022)
Infracost v0.10.7 adds a few outstanding features that have long been missing from the Infracost CLI. With this release, more users can now use Infracost CLI to get cloud estimates for their Terraform projects. 💪
New features
- Support for JSON input variable files. The
--terraform-var-file
flag now accepts validtfvars.json
files - by @hugorut in #1831 - Support for private Terraform registry modules. Users can now see prices for
module
blocks using a private registrysource
- by @hugorut in #1781 - Support for
oracle-se2-cdb
andoracle-ee-cdb
RDS engine types - by @philharle in #1793
Fixes
- Load remote variables if TFC workspace is set to agent execution mode - by @jgrumboe in #1787
- Various fixes for crashes and nil pointers because of empty configuration blocks:
- AWS DMS resource throwing nil pointer if
replication_instance_class
is the wrong format - by @aliscott in #1794 - Index out of range panic when
storage_os_disk
is not set onvirtual_machine
- by @aliscott in #1810 - Mock attribute overriding the default location, meaning prices are shown as $0 - by @hugorut in #1836
- Blank
geo_locations
causing panic errors forazurerm_cosmosdb_cassandra_keyspace
- by @hugorut in #1838
- AWS DMS resource throwing nil pointer if
New Contributors
- @philharle made their first contribution in #1793
Full Changelog: v0.10.6...v0.10.7
v0.10.6
0.10.6 (June 28 2022)
Infracost v0.10.6 contains a few minor fixes for upcoming features soon to have general availability.
Fixes
- Remove sending project context to dashboard - by @hugorut in #1777
- Introduce keyed mutex to wait for a
clone
to finish before access - by @hugorut in #1782
Full Changelog: v0.10.5...v0.10.6
v0.10.5
0.10.5 (June 23 2022)
Infracost v0.10.5 fixes a regression introduced in the v0.10.4 release. Upgrading an underlying Terragrunt library caused some users to have a sharp increase in the time it took for Infracost to process their projects. Thank you to @dgokcin for your quick work in reporting this issue.
Full Changelog: v0.10.4...v0.10.5
v0.10.4
0.10.4 (June 23 2022)
Infracost v0.10.4 improves Infracost's ability to evaluate Terraform files with missing contextual information. Improved expression support enhances user experience and cleans up several fatal errors that hindered CLI performance. We've also added a heavily requested --project-name
flag, allowing users to generate friendly names for their projects.
A note for Terragrunt users: Infracost's JSON metadata for Terragrunt projects will now show path
as relative to the run directory. This makes it consistent with Terraform projects.
New Features
- Add a new
--project-name
flag and name config field that allows users to customise the project name.--project-name
enables users to give projects a user-friendly name rather than displaying the project path. It also enables users to "group" projects under aproject-name
bucket. The project output is now changed to include the project name if specified, e.g.:by @tim775 in #1759Project: my friendly project Module path path/to/project/terraform Workspace: my-workspace ~ aws_instance.web_app -$561 ($1,303 → $743) ~ Instance usage (Linux/UNIX, on-demand, m5.8xlarge → m5.4xlarge) -$561 ($1,121 → $561) Monthly cost change for my workspace project (Module path: ../../../../examples/terraform, Workspace: ws1) Amount: -$561 ($1,303 → $743) Percent: -43%
- Add support for
AWSGlobalAccelerator
- by @carmeloriolo in #1721 - Add VCS metadata to project output. Additional metadata allows users who store historic runs to identify useful VCS data when analysing. New fields are listed below:
by @hugorut in #1758
"infracostCommand": the command associated with the run, one of breakdown, diff, output or comment "branch": name of the branch that was used to generate the estimate "commit": long commit SHA of the branch that was used to generate the estimate "commitAuthorName": git author name of the commit "commitAuthorEmail": git email of author of commit "commitTimestamp": timestamp of the commit, ISO 8601 UTC string "commitMessage": the commit message "vcsProvider": name of the VCS provider (github, gitlab, azure_repos, bitbucket) "vcsBaseBranch": name of the base branch that the pull request is being merged into "vcsPullRequestTitle": name of the pull request "vcsPullRequestUrl": link to the pull request "vcsPullRequestID": the unique identifier of the pull request for the vcsProvider "vcsPullRequestAuthor": name of the person who opened the pull request, this is probably the same as commitAuthor most of the time but it's helpful to see this if they're different "vcsPipelineRunId": a way to differentiate pipelines that are run within one PR, this is the top-level pipeline ID, not individual jobs/runs within it.
Fixes
- Update internals to use v3 azure provider - by @tim775 in #1763
- Set environment vars on Terragrunt run options, which enables
get_env
function to work correctly. - by @hugorut in #1764 - Add dummy return types for attributes that cannot evaluate. Mock return values enable expressions that rely on attributes/data that isn't available to HCL (e.g. populated from the cloud) to function correctly.
This fixes several cases for Terragrunt users usingdependency
blocks with outputs that relied on expressions that Infracost could not evaluate. - by @hugorut in #1723 - Properly handle
count
values set as a constant string rather than a number. Infracost now supports attributes likecount = "2"
. - by @hugorut in #1769 - Fixes
azure_mssql_database
fatal error when an explicitsku
is not set - by @hugorut in #1771
Full Changelog: v0.10.3...v0.10.4
v0.10.3
0.10.3 (June 10 2022)
Infracost v0.10.3 contains groundwork for upcoming changes to Infracost's authentication method. If you're interested in trying an early iteration of this feature, please see our docs: https://infracost.io/docs/infracost_cloud/authentication.
Full Changelog: v0.10.2...v0.10.3
v0.10.2
0.10.2 (June 08 2022)
Infracost v0.10.2 contains fixes for regressions that were introduced in v0.10.1. This release should provide a more stable experience to users, we recommend you upgrade as soon as you can.
Please note: HCL parsing continues to struggle with Terragrunt support, we are actively working on fixing these issues. Users who continue to have difficulties with Terragrunt please see this issue for a workaround. Please report any ongoing problems so that we can fix them as soon as possible.
Fixes
- Resolves a problem with multiple
exclude-path
flags being used - by @hugorut in #1714 - Fix panics originating from
cty.Null
values - by @hugorut in #1716 - Match downloaded modules based on key, solving "Failed to load module" error - by @aliscott in #1731
- Fix included Terragrunt dependency blocks with same name overwriting the parent - by @hugorut in #1733
- Change Azure product filters after Azure API changes - by @hugorut in #1734
Full Changelog: v0.10.1...v0.10.2
v0.10.1
0.10.1 (June 01 2022)
Infracost v0.10.1 contains several fixes for Terragrunt users struggling to run Infracost with HCL parsing. Users who continue to have difficulties with Terragrunt please see this issue for a workaround. Please report any ongoing problems so that we can fix them as soon as possible.
New Features
breakdown
anddiff
now support a--exclude-path
flag to ignore directories. This is particularly useful when running Infracost in a multi-project environment or Terragrunt setup - @hugorut in #1702- Add elasticache support for reserved instances - @carmeloriolo in #1677
Fixes
- Resolved several issues that Infracost had evaluating Terragrunt
dependency
blocks - @hugorut in #1687 - Fixed an unhandled panic originating from incorrect slice index in
azurerm_application_gateway
- @hugorut in #1686 - Rectified a problem where users could not run sync usage if using Elastic Beanstalk Environment - @vdmgolub in #1696
- Fixed issue where nested
module
blocks in HCL that used inputs frommodule
outputs received a nil value - @hugorut in #1697
Full Changelog: v0.10.0...v0.10.1
v0.10.0
What's new?
Back in February 2022, we started an experiment to estimate costs by parsing Terraform HCL code directly. We're excited to announce that the experiment worked! So in v0.10 we've removed the experimental --terraform-parse-hcl
flag and made HCL parsing the default behavior.
Going forward, we'll support two ways to run Infracost with Terraform via --path
:
- Parsing HCL code (directory): this is the default and recommended option as it has the following 5 key benefits.
# Terraform variables can be set using --terraform-var-file or --terraform-var infracost breakdown --path /code
- Parsing plan JSON file: this will continue to work as before.
cd /code terraform init terraform plan -out tfplan.binary terraform show -json tfplan.binary > plan.json infracost breakdown --path plan.json
1. Faster CLI
Infracost can now generate cost estimates without needing a Terraform plan. This removes our dependency on the Terraform binary altogether, which means no more terraform init
or terraform plan
.
That, in turn, means a super-fast CLI: Infracost used to take around 50 seconds to run on our internal Terraform mono-repo, that's now reduced to 2 seconds. 🚀
2. No cloud creds needed
Running terraform plan
requires users to have cloud credentials and Terraform secrets. The main reason we created the Infracost CLI first, instead of a web API, was so it could parse the Terraform plan JSON locally to extract cost-related parameters (e.g. instance type). Thus credentials and secrets were not sent anywhere.
Whilst this worked and was safe, it still posed a question: is there a way to avoid setting credentials or secrets altogether? Removing our dependency on terraform plan
gave us a way to do that.
3. Cost estimates everywhere
Not needing cloud credentials, or even knowledge of how to generate a Terraform plan, means that any engineer who has access to code repos can generate cost estimates!
This also opens the door for cost estimates to be put everywhere: Infra-as-Code repo readmes, Terraform module readmes, Visual Studio, and even in continuous integration systems where a Terraform plan does not exist (not everyone runs Terraform via continuous deployment systems).
To make infracost diff
work without a Terraform plan, we introduced a new --compare-to infracost-base.json
flag. This enables a git-based cost diff to be produced, e.g.:
git checkout main
infracost breakdown --path /code --format json --out-file infracost-base.json
git checkout my-branch
infracost diff --path /code --compare-to infracost-base.json
4. Compare Infracost runs
The infracost diff
command can now also be used to compare Infracost runs. Assuming you generated the files infracost-last-week.json
and infracost-today.json
using the infracost breakdown --path /code --format json
command, you can compare them using:
infracost diff --path infracost-today.json --compare-to infracost-last-week.json
5. Detect multi-project repos
Setting the --path
flag to a top-level repo directory will now attempt to process all projects automatically by:
- Looking at the specified path or in any of the subdirectories with a depth less than 5.
- Processing Terraform variable files with the
.auto.tfvars
extension (similar to what Terraform does). - Processing environment variables with a
TF_VAR_
prefix (similar to what Terraform does).
If this does not work for your use-case, use a config-file and run infracost breakdown --config-file=infracost.yml
, for example:
# infracost.yml
version: 0.1
projects:
- path: prod
terraform_var_files:
- prod.tfvars
- us-east.tfvars
- path: dev
terraform_var_files:
- dev.tfvars
Migration guides
👉👉👉 See the migration guides in the docs for migrating specific CI systems to use the new v0.10 Infracost version.
Removed functionality
See this docs section.
Known issues
See this docs section.
Other changes
New resources
- Support for
google_compute_per_instance_config
by @golgeek in #1645 - Support for
google_compute_region_per_instance_config
by @golgeek in #1657
AWS
- Support for reservation in
db_instance
by @carmeloriolo in #1653
Enhancements
- Add a better error message for errors originating from the Terragrunt libs by @aliscott in #1666
- Add breakdown path hint by @tim775 in #1673
- Fallback to the workspace defined by TF env for remote var loading by @hugorut in #1679
- Enable
-no-color
option by default for CI by @vdmgolub in #1628
Fixes
- Redis instance monthly pricing by @vdmgolub in #1627
- Mark azure b1 type machine as free by @tim775 in #1629
- Resolve SNS Topic notification price filters by @vdmgolub in #1633
- Solve support for references with for_each by @golgeek in #1640
- Rework reference mapping by @golgeek in #1660
- Computation of local scratch disk in GCP by @golgeek in #1655
- MSSQL Database License Type retrieval by @vdmgolub in #1664
- Update GCE inter-region egress filter by @tim775 in #1674
- Show only one cost component for Google Compute Address by @vdmgolub in #1639
New Contributors
- @golgeek made their first contribution in #1640
- @carmeloriolo made their first contribution in #1653
We also want to give a massive thank you to every community member who has helped us with any HCL parsing issues by reporting them and helping us reproduce them. Finding these issues would not have been possible without this 🎉.
v0.10.0-beta.1
What's Changed
The main change for the v0.10 version will be HCL parsing being the default for Terraform and Terragrunt directories, to allow for a fast default experience that doesn't require cloud credentials.
Relevant changes
- Make HCL parsing default and add --terraform-force-cli flag by @aliscott in #1630
- Enable HCL multi-project autodetect by @hugorut in #1631
Fixes
- Fix GCP Redis instance monthly pricing by @vdmgolub in #1627
- Ignore price for B1s - Free Azure instance by @tim775 in #1629
- Remove CI/CD register question by @tim775 in #1632
- Fix AWS SNS Topic notification price filters by @vdmgolub in #1633
Other changes
- Enable -no-color option by default for CI by @vdmgolub in #1628
- Skip certain release tasks for beta and alpha releases by @aliscott in #1634
Full Changelog: v0.9.24...v0.10.0-beta.1