Giter Club home page Giter Club logo

infracost's Introduction

Infracost logo

Community Slack channel Build Status Docker Image Tweet

Getting started

Infracost shows cloud cost estimates for infrastructure-as-code projects such as Terraform. It helps DevOps, SRE and developers to quickly see a cost breakdown and compare different options upfront.

Show full breakdown of costs

Infracost breakdown command

Show diff of monthly costs between current and planned state

Infracost diff command

Installation

  1. Assuming Terraform is already installed, get the latest Infracost release:

    macOS Homebrew:

    brew install infracost

    Linux/macOS manual download:

    # Downloads the CLI based on your OS/arch and puts it in /usr/local/bin
    curl -fsSL https://raw.githubusercontent.com/infracost/infracost/master/scripts/install.sh | sh

    Docker and Windows users see here.

  2. Register for a free API key:

    infracost register

    The key is saved in ~/.config/infracost/credentials.yml.

  3. Run Infracost using our example Terraform project to see how it works:

    git clone https://github.com/infracost/example-terraform.git
    cd example-terraform/sample1
    
    # Play with main.tf and re-run to compare costs
    infracost breakdown --path .
    
    # Show diff of monthly costs, edit the yml file and re-run to compare costs
    infracost diff --path . --sync-usage-file --usage-file infracost-usage.yml

Please watch/star this repo as we add new cloud resources every week or so.

Usage

The infracost CLI has the following main commands, their usage is described in our short getting started page:

  • breakdown: show full breakdown of costs
  • diff: show diff of monthly costs between current and planned state

As mentioned in our FAQ, no cloud credentials, secrets, tags or resource identifiers are sent to the Cloud Pricing API. That API does not become aware of your cloud spend; it simply returns cloud prices to the CLI so calculations can be done on your machine. Infracost does not make any changes to your Terraform state or cloud resources.

CI/CD integrations

The following CI/CD integrations can be used to automatically add a pull request comment showing the diff of monthly costs between the current and planned state:

If you run into any issues with CI/CD integrations, please join our community Slack channel, we'd be happy to guide you through it.

Example infracost diff usage

Supported clouds and resources

Infracost supports over 100 AWS and Google resources; Microsoft Azure is coming soon. Other IaC tools (Pulumi, CloudFormation) are on our roadmap too.

We regularly add support for new resources so we recommend watching this repo for releases: click on the Watch button > selecting Custom > Releases and click on Apply.

See this page for details on cost estimation of usage-based resources such as AWS Lambda or Google Cloud Storage.

Contributing

Issues and pull requests are welcome! For development details, see the contributing guide. For major changes, please open an issue first to discuss what you would like to change.

Join our community Slack channel, we are a friendly bunch and happy to help you get started :)

License

Apache License 2.0

infracost's People

Contributors

actions-user avatar alikhajeh1 avatar aliscott avatar anton-yurchenko avatar bmbferreira avatar chenrui333 avatar dependabot[bot] avatar ekifel avatar hakamadare avatar hassankhosseini avatar jgrumboe avatar joeunrue avatar keslerm avatar m-yosefpor avatar miladibra10 avatar mohammadkarimi23 avatar neverovds avatar nissessenap avatar oasys avatar pauluson avatar peterdavehello avatar praveenghuge avatar richardj-bsquare avatar robh007 avatar sashman avatar sinabakh avatar syphernl avatar tim775 avatar unfor19 avatar xeger avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.