infracost/vscode-infracost

Support Infracost usage file

hugorut opened this issue ยท 11 comments

Resources that solely use usage costs will have a 0.00 cost shown. We should alter the extension to allow users to supply a usage file, or parse it from a known location/name.

It's better that the logic lay within the Infracost CLI. As the VSCode native solution did not detect initialization.


Note for community
Please ๐Ÿ‘ if you'd like to upvote this or receive updates.
Add a comment if you'd like to contribute.

I think this is perfect, at first just identifying a file as an 'infracost-usage.yml' along with the terraform files, but in the future it would be perfect to be able to select the extension

Hello, I've just made a small change in the extension.ts file to add the support of infracost usage file by updating the breakdown command if I detect the presence of a infracost-usage.yml file in the project. I also add that file in the isValidTerraform file to re execute the infracost calculation if the infracost usage data is updated. I can do a PR if needed but for that I need to clean my code. Let me know if it's interesting for you and I will proceed

Hey @matthieupetite, sure thing, open a PR and we can have a look โค๏ธ

Ok, I do that after cleaning my code ... probably tonight or tomorrow ;)

@matthieupetite just wondering if there were any updates on this? Another user ran into an issue, which I think would be addressed by your proposed solution (detect infracost-usage.yml).

@alikhajeh1, @matthieupetite delivered a solution native to the VSCode extension, but it was decided that it was better that the logic lay within the CLI. As the VSCode native solution did not detect initialization.

Thanks for clarifying! I updated the issue desc.

Hello, I come back on this issue to see if there is a planned date for this. I am still working with my fork but it's too tricky and unstable :(

@matthieupetite I don't have an ETA on this unfortunately. I'll try and work on something this weekend, with aim to get a relase out late next week.

Hi all, we've added usage file support as part of the 0.2.11 release. The recommended way to let the extension know about usage, is by referencing it in a Infracost config file. Please give the latest release a whirl and let us know any bugs you find. ๐Ÿ™ .

Thanks a lot for that release