infracost / vscode-infracost

See cost estimates for Terraform right in your editor💰📉

Home Page:https://www.infracost.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unable to login when using a remote container

jacobwoffenden opened this issue · comments

When trying to "Connect VSCode to Infracost", nothing happens. I can see process being spawned, but it doesn't open a browser

Screenshot 2023-08-10 at 12 39 42

Running infracost auth login in the terminal displays the URL that I can click and open, and then authenticate, but then VSCode cannot use this token

Hello! The infracost auth login would work on local machine. If you want to run Infracost on a remote one, you'd need to do couple extra steps. From our Troubleshooting section:

  1. Register for a free API key from here. This is used by the extension to retrieve prices from our Cloud Pricing API, e.g. get prices for instance types.
  2. Install the infracost CLI.
  3. Run infracost configure set api_key MY_API_KEY_HERE.
  4. Re-open the VSCode extension, it should now skip the "connect to Infracost" step as it uses the same API key from the CLI.

Hope this helps :)

Shame on me for not reading the docs!

Thanks, @vdmgolub