Infracost VSCode ExtensionInfracost's VSCode extension shows you cost estimates for Terraform right in your editor! Prevent costly infrastructure changes before they get into production. This helps with a few use-cases:
FeaturesSee cost estimates right above their Terraform definitions. Infracost's output updates on file save. Works with resources and modulesBoth See cost breakdownIf a simple monthly cost isn't enough for you, just click the overview to see a cost breakdown. Navigate your projects by costsSee a tree overview of your Infrastructure costs. See which projects, files and blocks have the most impact to your budget. Get started1. Install VSCode extensionOpen VSCode and install the Infracost extension. This will also install the the Hashicorp Terraform extension extension if you don't already have it.
2. Connect VSCode to InfracostOnce you've installed the extension, you'll need to connect to your editor to your Infracost account. Click the "connect to Infracost" button in the Infracost sidebar. This will open a browser window where you'll be able to log in to Infracost Cloud and authenticate your editor. 3. Use extensionNavigate to any Terraform file, if you've done the prior steps correctly you'll see costs above supported blocks.
4. Cost estimates in pull requestsUse our CI/CD integrations to add cost estimates to pull requests. This provides your team with a safety net as people can understand cloud costs upfront, and discuss them as part of your workflow. RequirementsThe Infracost VSCode extension requires you to have:
FAQsHow can I supply input variables to Infracost VSCode extension?To supply input variables for your Terraform projects, you must include a var file called How can I configure the currency Infracost uses?To set the currency, run TroubleshootingKnown Issues
Locating Infracost error logsIf 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:
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. ContributingWe 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.
Once you're finished with your work, open a PR, and we'll be happy to review it as soon as possible. |