infracost / vscode-infracost

See cost estimates for Terraform right in your editor💰📉
https://www.infracost.io/
Apache License 2.0
1.8k stars 56 forks source link

Unable to login when using a remote container #191

Closed jacobwoffenden closed 1 year ago

jacobwoffenden commented 1 year ago

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

vdmgolub commented 1 year ago

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 :)

jacobwoffenden commented 1 year ago

Shame on me for not reading the docs!

Thanks, @vdmgolub