-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extension does not work with Terraform workspaces that use prefix
configuration
#21
Comments
Hey @lkolchin, thanks for raising this issue. So I've got a couple of questions, I have a sneaky suspicion that the extension might not actually be failing because of the workspace:
when you've located that and you received the
there should be some further error information in the logs that I'd be grateful if you post here. Many thanks |
Thanks for your reply, Without specifying the workspace it fails (In the app1 directory):
And seeing exactly the same issue in the "Debug Output": I am using TF cloud as a backend that looks something like that:
I'm using a pretty neat way where my workspaces are essentially the same across 'local', 's3', 'TF Cloud' backends which allows for a great code mobility. If you can't replicate this error using the above info I could create a dummy repo for you to try. |
Thanks, @lkolchin, for the follow-up information; ah yes, this is a use case we run into quite a lot. Right now, as you're aware, the extension doesn't support this, as it's somewhat naive in the way it runs the underlying Infracost command. I'll look at supporting this use case ASAP, probably with the option to configure the workspace through the UI. In the meantime, to get the Infracost extension actually working with your setup you could do something like so:
In your Terraform project. I know this isn't great, but it's a workaround until we get this implemented. |
prefix
configuration
Thanks @hugorut , Unfortunately using specific workspace in the backend config (using "name=workspacename") is not an option as we have those workspaces set in a somewhat dynamic way in our CI/CD. There might be multiple CLI workspaces dev/test/prod that work off the same repo and correspond to different Terraform Cloud workspaces (some-aws-shakeout-ec2-app1-dev/some-aws-shakeout-ec2-app1-test/some-aws-shakeout-ec2-app1-prod). Here is a little snippet that can give you an idea on how we are doing it (Might give you some ideas when you work on your fix):
Happy to test it again when you come up with a fix :) |
Hi @lkolchin, I wasn't suggesting committing these changes, just setting the workspace as something static whilst you work on the project locally. Thanks for the snippet/example 👍 |
Hi @hugorut , Just tested your suggestion locally.
And it didn't help as vscode didn't show anything.
|
Hmm @lkolchin this seems odd, I'm working on some fixes this weekend which should give some better debug support so once those are live could I ask you to run again and see what's going on? Many thanks for proving these useful comments 🙏 |
Sure, no worries I'll give it a go. |
Hi @lkolchin, hmm, seem's like we'll need a way for users to provide this workspace in the editor. A workaround for this at the moment is to try and set a global env variable called Regarding the version, I'm seeing the What is your machine showing? The warning from Apple is if you have manually downloaded the release through chrome. I don't recommend doing this, but instead using our manual install script which downloads the latest release from github:
|
Thanks @hugorut , I think there is a problem with 10.9 for M1 (Apple silicon - arm64 arch).
You need to upload the version for arm64? Anyway, I've tried your suggestion with:
And it still doesn't show the costs in the vscode: |
@lkolchin I'm running on Ok thanks for the update on the env var, this looks like we'll have to modify the underlying process. This is on the roadmap, but I don't have an estimate when we'll get to it. |
Hello,
I'm working with multiple workspaces (with either s3, local or tf cloud backends).
Now I've enabled infracost extension and in vscode I'm getting an error (in the vscode editor):
It does work on the cli when I specify the workspace though:
Currently got a 'dev' workspace:
Why can't you do something like this in the extension to figure out the active workspace?
Any way to fix it?
The text was updated successfully, but these errors were encountered: