Cloud cost estimates for Terraform in pull requests๐ฐ๐ Love your cloud bill!
APACHE-2.0 License
Bot releases are visible (Hide)
Published by github-actions[bot] about 2 years ago
Infracost 0.10.11 contains significant updates to improve VCS detection. In addition, we've added the ability to override detection, which enables users to specify how they want their VCS data displayed in Infracost Cloud.
Users should be aware that with 0.10.11 release, the vcsRepoUrl
metadata attribute has been changed to vcsRepositoryUrl
:
{
"vcsPullRequestUrl": "https://github.com/infracost/infracost/pull/42",
- "vcsRepoUrl": "https://github.com/infracost/infracost.git",
+ "vcsRepositoryUrl": "https://github.com/infracost/infracost.git",
"vcsProvider": "github",
"vcsBaseBranch": "master",
"vcsPullRequestTitle": "Some PR title",
"vcsPullRequestId": "4321"
...
}
- `INFRACOST_VCS_PROVIDER`: can be "github", "gitlab", "azure_repos" or "bitbucket"
- `INFRACOST_VCS_REPOSITORY_URL`: HTTPS URL of the repository, e.g. "https://github.com/infracost/example-terraform"
- `INFRACOST_VCS_PULL_REQUEST_URL`: HTTP URL of the pull request, e.g. "https://github.com/alikhajeh1/example-terraform/pull/2"
- `INFRACOST_VCS_PULL_REQUEST_AUTHOR`: author username or full name of the pull request, e.g. "john190" or "John Smith"
- `INFRACOST_VCS_PULL_REQUEST_TITLE`: title of the pull request, e.g. "Increase IOPS"
- `INFRACOST_VCS_BRANCH`: name of the branch that was used to generate the estimate, e.g. "increase_iops"
- `INFRACOST_VCS_COMMIT_SHA`: long commit SHA of the branch that was used to generate the estimate, e.g. "1af413ad15ad6cbdfca667361231231231231231"
- `INFRACOST_VCS_COMMIT_MESSAGE`: the commit message, e.g. "use m5.large"
- `INFRACOST_VCS_COMMIT_TIMESTAMP`: unix epoch timestamp of the commit, e.g. `1661801540`. You can use the following command to get the timestamp on the latest commit from the current branch `export INFRACOST_VCS_COMMIT_TIMESTAMP=$(git show -s --format=%ct)`
- `INFRACOST_VCS_COMMIT_AUTHOR_EMAIL`: git email of author of the commit, e.g. "[email protected]"
- `INFRACOST_VCS_COMMIT_AUTHOR_NAME`: git author name of the commit, e.g. "John Smith"
- `INFRACOST_VCS_PIPELINE_RUN_ID`: a way to differentiate pipelines that are run within one CI/CD run, this is the top-level pipeline ID, not individual jobs/runs within it, e.g. "2846680866"
by @hugorut in https://github.com/infracost/infracost/pull/1990
infracost upload
command which supports uploading an Infracost JSON file to Infracost Cloud without the need for infracost comment
. This command uploads the data regardless of your Org Settings or the INFRACOST_ENABLE_CLOUD
environment variable. - by @tim775 in https://github.com/infracost/infracost/pull/1997
go-git
dependency to fix panics reported by Windows users - by @hugorut in https://github.com/infracost/infracost/pull/1989
azurerm_function_app
and azurerm_mysql_flexible_server
price filters so they no longer show zero prices - by @aliscott in https://github.com/infracost/infracost/pull/1992
Full Changelog: https://github.com/infracost/infracost/compare/v0.10.10...v0.10.11
Published by github-actions[bot] about 2 years ago
Infracost v0.10.10 contains fixes and enhancements for the CLI, many of them improving support in the Infracost VS Code extension.
cty.ObjectType
by @hugorut in https://github.com/infracost/infracost/pull/1956
Full Changelog: https://github.com/infracost/infracost/compare/v0.10.9...v0.10.10
Published by github-actions[bot] about 2 years ago
๐ ๐ Infracost v0.10.9 contains a number of fixes for the CLI that are discovered when used with the Infracost VS Code extension support. It also contains several enhancements to how our CLI integrates with Infracost Cloud, to enable it to work with additional CI/CD platforms such as Atlantis, Azure Repos and Bitbucket.
enable_cloud
setting is enabled @tim775 in https://github.com/infracost/infracost/pull/1880
Panic and runtime errors caused by incomplete VS Code Terraform files
interface conversion
by @hugorut in https://github.com/infracost/infracost/pull/1896
value is unknown panic
by @hugorut in https://github.com/infracost/infracost/pull/1888
ForDisplay called on invalid Hostname
panic by @hugorut in https://github.com/infracost/infracost/pull/1895
index out of range [1] with length 1
panic for aws_codebuild_project
by @hugorut in https://github.com/infracost/infracost/pull/1894
Other fixes:
for_each
or count
by @aliscott in https://github.com/infracost/infracost/pull/1885
NAME
env variable overriding the project name by @aliscott in https://github.com/infracost/infracost/pull/1919
aws_ecs_service
to work when referencing a aws_ecs_task_definition
with a family
attribute by @aliscott in https://github.com/infracost/infracost/pull/1917
Full Changelog: https://github.com/infracost/infracost/compare/v0.10.8...v0.10.9
Published by github-actions[bot] over 2 years ago
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:
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.
monthly_hrs
usage field - by @jessecureton in https://github.com/infracost/infracost/pull/1812
--exclude-cli-output
option. Allowing users to truncate long Bitbucket comments - by @vdmgolub in https://github.com/infracost/infracost/pull/1881
--debug-report
flag, which generates a rich JSON debugging report. This helps Infracost maintainers debug problems quickly - @hugorut in https://github.com/infracost/infracost/pull/1808
Updated path variables for Terraform file functions. This fixes problems with users trying to load files in child modules - by @tim775 in https://github.com/infracost/infracost/pull/1849
Tweaked product filters for Google Storage Bucket - by @vdmgolub in https://github.com/infracost/infracost/pull/1868
Better automatic project name detection - by @hugorut in https://github.com/infracost/infracost/pull/1878
Several panic and runtime errors caused by incomplete VSCode Terraform files
storage_profile_os_disk
block - by @aliscott in https://github.com/infracost/infracost/pull/1864
cty.NilVal
to HCL expressions when in a partial evaluation state - by @hugorut in https://github.com/infracost/infracost/pull/1867
Full Changelog: https://github.com/infracost/infracost/compare/v0.10.7...v0.10.8
Published by github-actions[bot] over 2 years ago
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. ๐ช
--terraform-var-file
flag now accepts valid tfvars.json
files - by @hugorut in https://github.com/infracost/infracost/pull/1831
module
blocks using a private registry source
- by @hugorut in https://github.com/infracost/infracost/pull/1781
oracle-se2-cdb
and oracle-ee-cdb
RDS engine types - by @philharle in https://github.com/infracost/infracost/pull/1793
replication_instance_class
is the wrong format - by @aliscott in https://github.com/infracost/infracost/pull/1794
storage_os_disk
is not set on virtual_machine
- by @aliscott in https://github.com/infracost/infracost/pull/1810
geo_locations
causing panic errors for azurerm_cosmosdb_cassandra_keyspace
- by @hugorut in https://github.com/infracost/infracost/pull/1838
Full Changelog: https://github.com/infracost/infracost/compare/v0.10.6...v0.10.7
Published by github-actions[bot] over 2 years ago
Infracost v0.10.6 contains a few minor fixes for upcoming features soon to have general availability.
clone
to finish before access - by @hugorut in https://github.com/infracost/infracost/pull/1782
Full Changelog: https://github.com/infracost/infracost/compare/v0.10.5...v0.10.6
Published by github-actions[bot] over 2 years ago
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: https://github.com/infracost/infracost/compare/v0.10.4...v0.10.5
Published by github-actions[bot] over 2 years ago
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.
--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 a project-name
bucket. The project output is now changed to include the project name if specified, e.g.:
Project: 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%
by @tim775 in https://github.com/infracost/infracost/pull/1759
AWSGlobalAccelerator
- by @carmeloriolo in https://github.com/infracost/infracost/pull/1721
"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.
by @hugorut in https://github.com/infracost/infracost/pull/1758
get_env
function to work correctly. - by @hugorut in https://github.com/infracost/infracost/pull/1764
dependency
blocks with outputs that relied on expressions that Infracost could not evaluate. - by @hugorut in https://github.com/infracost/infracost/pull/1723
count
values set as a constant string rather than a number. Infracost now supports attributes like count = "2"
. - by @hugorut in https://github.com/infracost/infracost/pull/1769
azure_mssql_database
fatal error when an explicit sku
is not set - by @hugorut in https://github.com/infracost/infracost/pull/1771
Full Changelog: https://github.com/infracost/infracost/compare/v0.10.3...v0.10.4
Published by github-actions[bot] over 2 years ago
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: https://github.com/infracost/infracost/compare/v0.10.2...v0.10.3
Published by github-actions[bot] over 2 years ago
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.
exclude-path
flags being used - by @hugorut in https://github.com/infracost/infracost/pull/1714
cty.Null
values - by @hugorut in https://github.com/infracost/infracost/pull/1716
Full Changelog: https://github.com/infracost/infracost/compare/v0.10.1...v0.10.2
Published by github-actions[bot] over 2 years ago
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.
breakdown
and diff
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 https://github.com/infracost/infracost/pull/1702
dependency
blocks - @hugorut in https://github.com/infracost/infracost/pull/1687
azurerm_application_gateway
- @hugorut in https://github.com/infracost/infracost/pull/1686
module
blocks in HCL that used inputs from module
outputs received a nil value - @hugorut in https://github.com/infracost/infracost/pull/1697
Full Changelog: https://github.com/infracost/infracost/compare/v0.10.0...v0.10.1
Published by github-actions[bot] over 2 years ago
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
:
# Terraform variables can be set using --terraform-var-file or --terraform-var
infracost breakdown --path /code
cd /code
terraform init
terraform plan -out tfplan.binary
terraform show -json tfplan.binary > plan.json
infracost breakdown --path plan.json
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. ๐
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.
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
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
Setting the --path
flag to a top-level repo directory will now attempt to process all projects automatically by:
.auto.tfvars
extension (similar to what Terraform does).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
๐๐๐ See the migration guides in the docs for migrating specific CI systems to use the new v0.10 Infracost version.
See this docs section.
See this docs section.
google_compute_per_instance_config
by @golgeek in https://github.com/infracost/infracost/pull/1645
google_compute_region_per_instance_config
by @golgeek in https://github.com/infracost/infracost/pull/1657
db_instance
by @carmeloriolo in https://github.com/infracost/infracost/pull/1653
-no-color
option by default for CI by @vdmgolub in https://github.com/infracost/infracost/pull/1628
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 ๐.
Published by github-actions[bot] over 2 years ago
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.
Full Changelog: https://github.com/infracost/infracost/compare/v0.9.24...v0.10.0-beta.1
Published by github-actions[bot] over 2 years ago
Infracost v0.9.24 fixes minor inconsistencies we released in v0.9.23. The most important being the --compare-to
flag is now exclusive to the diff
command. Thank you to all the fantastic community members who helped us try out the interim interface and gave your feedback.
diff
using --compare-to
The diff
command --compare-to
flag enables you to compare different Infracost runs (using their JSON output), for example:
git clone https://github.com/infracost/example-terraform.git
cd example-terraform/sample1
# Generate JSON file from an Infracost run
infracost breakdown --path . --terraform-parse-hcl --format json --out-file infracost-run.json
# Update the Terraform code by changing the instance type to m5.8xlarge
vim main.tf
# Show cost estimate diff
infracost diff --path . --terraform-parse-hcl --compare-to infracost-run.json
Read more about this behaviour in our docs
--compare-to
flag to only be used by diff - by @hugorut in https://github.com/infracost/infracost/pull/1620
The HCL parsing method will become the default behavior of the infracost breakdown
and infracost diff
commands in v0.10.0 of the CLI. We haven't finalized the interface yet, but it's likely that the --terraform-parse-hcl
flag will be removed so there will be two main ways to use Infracost:
https://github.com/infracost/docs/pull/215
Full Changelog: https://github.com/infracost/infracost/compare/v0.9.23...v0.9.24
Published by github-actions[bot] over 2 years ago
Infracost v0.9.23 contains support for parsing HCL with Terraform Cloud remote execution mode, TF_VAR_ env variables and Terragrunt. There's also a new --compare-to
flag that enables you to compare different Infracost runs ๐
Thank you to our amazing community members who helped us diagnose, triage and fix bugs, you rock!
The infracost breakdown --terraform-parse-hcl
experimental flag received very positive feedback, so we also added it to infracost diff
! We also added a new --compare-to
flag that enables you to compare different Infracost runs (using their JSON output), for example:
git clone https://github.com/infracost/example-terraform.git
cd example-terraform/sample1
# Generate JSON file from an Infracost run
infracost breakdown --path . --terraform-parse-hcl --format json --out-file infracost-run.json
# Update the Terraform code by changing the instance type to m5.8xlarge
vim main.tf
# Show cost estimate diff
infracost diff --path . --terraform-parse-hcl --compare-to infracost-run.json
Checkout the docs for:
infracost breakdown --terraform-parse-hcl
infracost diff --terraform-parse-hcl --compare-to infracost-run.json
The HCL parsing method will become the default behavior of the infracost breakdown
and infracost diff
commands in v0.10.0 of the CLI. We haven't finalized the interface yet, but it's likely that the --terraform-parse-hcl
flag will be removed so there will be two main ways to use Infracost:
https://github.com/infracost/docs/pull/203/files
Full Changelog: https://github.com/infracost/infracost/compare/v0.9.22...v0.9.23
Published by github-actions[bot] over 2 years ago
Infracost v0.9.22 contains several major fixes for HCL parsing as well as support for some heavily requested new resources. Thank you to our amazing community members who helped us diagnose, triage and fix bugs, you rock โค๏ธ!
AWS
Azure
count
attributes - by @hugorut in https://github.com/infracost/infracost/pull/1548, https://github.com/infracost/infracost/pull/1543, https://github.com/infracost/infracost/pull/1542
google_container_cluster
missing references with existing Terraform state - by @hugorut in https://github.com/infracost/infracost/pull/1508
aws_dynamodb_table
- by @hugorut in https://github.com/infracost/infracost/pull/1521
azurerm_kubernetes_cluster_node_pool
- by @hugorut in https://github.com/infracost/infracost/pull/1531
aws_ecs_cluster
launch type from capacity providers if available - by @tim775 in https://github.com/infracost/infracost/pull/1533
aws_kinesis_firehose_delivery_stream
subnet_ids
attribute resolving as empty before apply - by @aliscott in https://github.com/infracost/infracost/pull/1544
Full Changelog: https://github.com/infracost/infracost/compare/v0.9.21...v0.9.22
Published by github-actions[bot] over 2 years ago
Infracost v0.9.21 contains several new features, general codebase improvements and some bug fixes. Thank you, our awesome community, for making this release possible!
terraform-init-flags
flag to fine tune Terraform usage with Infracost. Here's an example how to use it - by @hugorut in https://github.com/infracost/infracost/pull/1471
--show-skipped
flag in breakdown
and diff
output. When set it will list unsupported and free resources - by @vdmgolub in https://github.com/infracost/infracost/pull/1477
AWS
Azure
subnet_ids
attribute empty without apply state - by @hugorut in https://github.com/infracost/infracost/pull/1504
terraform-parse-hcl
flag in the CLI's help output now, so more users can discover and try it out - by @hugorut in https://github.com/infracost/infracost/pull/1473
Full Changelog: https://github.com/infracost/infracost/compare/v0.9.20...v0.9.21
Published by github-actions[bot] over 2 years ago
If you are using any of the CI bash scripts, please upgrade as soon as possible
These scripts have been replaced by dedicated integrations with most CI/CD platforms, which we recommend you upgrading to:
Please visit Infracost.io/cicd for other CI/CD integrations and more information.
These scripts will be removed September 2022. If you are pulling them directly from this repository and cannot upgrade before then, we recommend you keeping a copy in your own repositories.
Infracost v0.9.20 contains some exciting new features, general codebase improvements and some bug fixes. Thanks as always to our amazing community who made this release possible.
AWS
google_container_cluster
duplicating node pools when applied - by @aliscott in https://github.com/infracost/infracost/pull/1463
Infracost comment
has better error reporting if communication issues arise between the GitHub API and Infracost - by @vdmgolub in https://github.com/infracost/infracost/pull/1443
https://github.com/infracost/docs/pull/177
Full Changelog: https://github.com/infracost/infracost/compare/v0.9.19...v0.9.20
Published by github-actions[bot] over 2 years ago
Add HCL-only provider by @hugorut in https://github.com/infracost/infracost/pull/1303,
Infracost can parse the Terraform HCL code directly without having to generate a plan JSON. This is useful if you want to run Infracost without having access to the Terraform binary or any cloud credentials that Terraform requires. It is also faster than generating a plan JSON. see usage docs
Add zip archives to release by @hugorut in https://github.com/infracost/infracost/pull/1389, see the release page for the files
On release trigger chocolatey-packages workflow by @hugorut in https://github.com/infracost/infracost/pull/1398, Windows users can now just run choco install infracost
or choco upgrade infracost
New AWS resources:
Full Changelog: https://github.com/infracost/infracost/compare/v0.9.18...v0.9.19
Published by github-actions[bot] over 2 years ago
infracost comment bitbucket --help
for an example of how to post cost estimates to Bitbucket Cloud/Server, or see the docs here
infracost output
to generate the comment markdown (so you can post it manually)sku.size
for azurerm_app_service_plan
by @tim775 in https://github.com/infracost/infracost/pull/1366
Full Changelog: https://github.com/infracost/infracost/compare/v0.9.17...v0.9.18