infracost

Cloud cost estimates for Terraform in pull requests๐Ÿ’ฐ๐Ÿ“‰ Love your cloud bill!

APACHE-2.0 License

Stars
9.8K
Committers
92

Bot releases are visible (Hide)

infracost - v0.10.11

Published by github-actions[bot] about 2 years ago

What's Changed

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 Cloud enhancements:

  • Infracost CLI has improved metadata support, meaning more platforms and deployment systems work out of the box with Infracost Cloud. Additional VCS environment variables have also been added to the CLI. Users can use these to override Infracost VCS detection. A complete list of supported environment variables is below - see our docs for examples:
    - `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
  • A new 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

New Features

Fixes

New Contributors

Full Changelog: https://github.com/infracost/infracost/compare/v0.10.10...v0.10.11

infracost - v0.10.10

Published by github-actions[bot] about 2 years ago

What's Changed

Infracost v0.10.10 contains fixes and enhancements for the CLI, many of them improving support in the Infracost VS Code extension.

Enhancements

Fixes

Dependency updates

Full Changelog: https://github.com/infracost/infracost/compare/v0.10.9...v0.10.10

infracost - v0.10.9

Published by github-actions[bot] about 2 years ago

What's Changed

๐Ÿ› ๐Ÿ“‰ 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.

Infracost Cloud enhancements:

Fixes

Panic and runtime errors caused by incomplete VS Code Terraform files

Other fixes:

Dependency updates

New Contributors

Full Changelog: https://github.com/infracost/infracost/compare/v0.10.8...v0.10.9

infracost - v0.10.8

Published by github-actions[bot] over 2 years ago

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:

  1. What are the top pull requests that will increase/decrease costs the most? Who is working on them?
  2. 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

Azure

Fixes

New Contributors

Full Changelog: https://github.com/infracost/infracost/compare/v0.10.7...v0.10.8


infracost - v0.10.7

Published by github-actions[bot] over 2 years ago

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

Fixes

New Contributors

Full Changelog: https://github.com/infracost/infracost/compare/v0.10.6...v0.10.7

infracost - v0.10.6

Published by github-actions[bot] over 2 years ago

0.10.6 (June 28 2022)

Infracost v0.10.6 contains a few minor fixes for upcoming features soon to have general availability.

Fixes

Full Changelog: https://github.com/infracost/infracost/compare/v0.10.5...v0.10.6

infracost - v0.10.5

Published by github-actions[bot] over 2 years ago

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: https://github.com/infracost/infracost/compare/v0.10.4...v0.10.5

infracost - v0.10.4

Published by github-actions[bot] over 2 years ago

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 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
  • Add support for AWSGlobalAccelerator - by @carmeloriolo in https://github.com/infracost/infracost/pull/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:
        "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

Fixes

Full Changelog: https://github.com/infracost/infracost/compare/v0.10.3...v0.10.4

infracost - v0.10.3

Published by github-actions[bot] over 2 years ago

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: https://github.com/infracost/infracost/compare/v0.10.2...v0.10.3

infracost - v0.10.2

Published by github-actions[bot] over 2 years ago

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

Full Changelog: https://github.com/infracost/infracost/compare/v0.10.1...v0.10.2

infracost - v0.10.1

Published by github-actions[bot] over 2 years ago

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


Fixes

Full Changelog: https://github.com/infracost/infracost/compare/v0.10.0...v0.10.1

infracost - v0.10.0

Published by github-actions[bot] over 2 years ago

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:

  1. 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
    
  2. 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:

  1. Looking at the specified path or in any of the subdirectories with a depth less than 5.
  2. Processing Terraform variable files with the .auto.tfvars extension (similar to what Terraform does).
  3. 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

Google

AWS

Enhancements

Fixes

New Contributors

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 ๐ŸŽ‰.

infracost - v0.10.0-beta.1

Published by github-actions[bot] over 2 years ago

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

Fixes

Other changes

Full Changelog: https://github.com/infracost/infracost/compare/v0.9.24...v0.10.0-beta.1

infracost - v0.9.24

Published by github-actions[bot] over 2 years ago

0.9.24 (May 04 2022)

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.

Infracost 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

Relevant changes

New resources

Fixes

New Contributors

Announcements

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:

  • Option 1: Terraform directoryโ€‹ (good for source control systems such as GitHub)
  • Option 2: Terraform plan JSONโ€‹ (good for deployment systems such as Terraform Cloud)

Docs

https://github.com/infracost/docs/pull/215

Full Changelog: https://github.com/infracost/infracost/compare/v0.9.23...v0.9.24

infracost - v0.9.23

Published by github-actions[bot] over 2 years ago

0.9.23 (April 29 2022)

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!


Faster and simpler way to run Infracost

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:

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:

  • Option 1: Terraform directoryโ€‹ (good for source control systems such as GitHub)
  • Option 2: Terraform plan JSONโ€‹ (good for deployment systems such as Terraform Cloud)

Relevant changes:

  • feat: Add support for HCL parsing of Terragrunt projects by @tim775 in #1571
  • feat: Add support for TF_VAR_ environment variables when parsing HCL by @tim775 in #1586
  • feat: Load TFC remote execution variables for HCL parsing by @vdmgolub in #1589
  • feat: add compare-to flag to compare diffs across runs by @hugorut in #1570

New resources

  • feat(aws): Add launch template support for Instance resource by @vdmgolub in #1564
  • feat(google): Add usage parameter for Compute Address/Global Address by @vdmgolub in #1573

Fixes

  • fix(hcl): evalute modules in order of reference by @hugorut in #1568
  • fix: Match on the whole markdown tag when finding existing comments by @tim775 in #1581
  • fix: Lookup region from resource_group_name by @tim775 in #1582
  • fix: Don't error when using terragrunt dependencies by @tim775 in #1591
  • fix(azure): fix public ip standard pricing by @hugorut in #1592
  • fix: fix polluting the OS env variables by @aliscott in #1587

Other improvements

  • ci(fig): update autocomplete spec automatically by @fedeci in #1565
  • refactor(azure): resource migrations batch 1 by @sinabakh in #1540
  • chore(aws): Load EBS block devices from LT for Instance resource by @vdmgolub in #1580

Docs

https://github.com/infracost/docs/pull/203/files

Full Changelog: https://github.com/infracost/infracost/compare/v0.9.22...v0.9.23

infracost - v0.9.22

Published by github-actions[bot] over 2 years ago

0.9.22 (April 13 2022)

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 โค๏ธ!


New Features

AWS

Azure


Fixes

Other improvements


Docs

Full Changelog: https://github.com/infracost/infracost/compare/v0.9.21...v0.9.22

infracost - v0.9.21

Published by github-actions[bot] over 2 years ago

0.9.21 (March 30 2022)

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!


New Features

AWS

Google

Azure


Fixes

Other improvements


Docs

New Contributors

Full Changelog: https://github.com/infracost/infracost/compare/v0.9.20...v0.9.21

infracost - v0.9.20

Published by github-actions[bot] over 2 years ago

0.9.20 (March 16 2022)

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.

New Features

Github failing policy

AWS

Google


Fixes


Docs

https://github.com/infracost/docs/pull/177

New Contributors

Full Changelog: https://github.com/infracost/infracost/compare/v0.9.19...v0.9.20

infracost - v0.9.19

Published by github-actions[bot] over 2 years ago

What's Changed

New Features/resources

New AWS resources:

Enhancements

Docs

Fixes

New Contributors

Full Changelog: https://github.com/infracost/infracost/compare/v0.9.18...v0.9.19

infracost - v0.9.18

Published by github-actions[bot] over 2 years ago

What's Changed

New Features/resources

Enhancements

Docs

Fixes

New Contributors

Full Changelog: https://github.com/infracost/infracost/compare/v0.9.17...v0.9.18

Package Rankings
Top 4.02% on Proxy.golang.org
Related Projects