Skip to content

See cost estimates for Terraform right in your editor💰📉

License

Notifications You must be signed in to change notification settings

dwalker-sabiogroup/vscode-infracost

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Infracost VSCode Extension

Infracost's VSCode extension shows you cost estimates for Terraform right in your editor! Prevent costly infrastructure changes before they get into production.

Features

Infracost's extension shows a snapshot of the total cost of resources right above their Terraform definitions. Infracost's output updates on file save.

Both resource and module blocks support showing cost estimates. Infracost's VSCode extension even supports showing prices on 3rd party module blocks!

If a simple monthly cost isn't enough for you, just click the overview to show a detailed breakdown of what components affect the price.

Demo

Check out the video below to see the Infracost extension in action!

Infracost.VSCode.extension.mp4

Getting started

  1. Install Infracost CLI on your machine & register for an API key.
  2. Open VSCode and install the Infracost extension. This will also install the the Hashicorp Terraform extension extension if you don't already have it.
  3. Navigate to any Terraform file, if you've done the prior steps correctly you'll see costs above supported blocks.

Requirements

The Infracost VSCode extension requires you to have:

  • VSCode v1.67.0 or above.
  • Infracost CLI version v0.10.6 or above installed and registered with a valid API key.
  • The Terraform VSCode extension installed and enabled in VSCode.

Troubleshooting

Known Issues

  • When opening a workspace with a large number of Terraform projects for the first time. Infracost will evaluate all the projects and download any required modules. This means that it might take some time before pricing information is available. If you're worried that Infracost VSCode extension isn't working in your workspace but haven't got any error messages, it is likely that Infracost is still indexing your workspace. The extension has a status bar on the right-hand side of the editor which will show a loading state when Infracost is running.

  • Terragrunt is not supported. Follow this issue for more information for future updates about Terragrunt support.

  • Infracost usage files are not yet supported. This means that resources that solely use usage costs will have a 0.00 cost shown:

    Follow this issue to receive updates on usage file support.

  • Diff functionality is not yet supported. Follow this issue to receive updates on diff support.

  • VSCode Infracost does not yet work with Infracost config files. Multi project support is available using Infracost native auto-detection. This means that the first time running in a multi-project workspace might be quite slow. Follow this issue to receive updates on config file support.

Locating Infracost error logs

If you're having problems with the extension and your problem isn't any of the known issues above, you can find the Infracost extension logs using the following method:

  1. Open the extension terminal using the top menu (Terminal->New Terminal)
  2. Select Output and log (Window) from the dropdown

The log there might give you more information for a problem you can fix on your own, e.g. syntax errors. If it's something more ominous please raise an issue, so that we can identify and fix the problem. Please include as much of the log information as you can and any other helpful information like OS and VSCode workspace size.

Contributing

We love any contribution, big or small. If you want to change the Infracost VSCode extension, we recommend you use VSCode to build and develop the extension locally.

  1. Clone the repo.
  2. yarn install all the dependencies.
  3. Open the repo in VSCode.
  4. Install the Terraform VSCode extension in VSCode.
  5. Inside the editor, press F5. VSCode will compile and run the extension in a new Development Host window.
  6. Open a Terraform project, and navigate to a valid file. If all the previous steps have been followed correctly, you should see Infracost cost estimates above supported resource blocks.

Once you're finished with your work, open a PR, and we'll be happy to review it as soon as possible.

About

See cost estimates for Terraform right in your editor💰📉

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 74.0%
  • Handlebars 21.8%
  • JavaScript 4.2%