https://infracost.io logo
#general
Title
# general
b

best-action-5428

11/30/2023, 10:39 PM
Hi infracost wizards , Is there a way to disable the automatic creation of .infracost folder by infracost VScode pluggin everytime a new workspace ops a tf directory?
w

white-airport-8778

12/01/2023, 8:35 AM
Hey @best-action-5428! that folder is used to cache the downloaded modules otherwise they’ll have to be downloaded each time you save a file and Infracost needs to run… Add it to your .gitignore so you can ignore it
b

busy-agent-35515

12/01/2023, 10:37 AM
b

best-action-5428

12/01/2023, 1:57 PM
Thanks Ali and Vadim . I guessed it had to do with some cache function and thanks for the gitignore tip, but the thing is, I have tf directories with providers that aren't supported at all by infracost like OCI . So It doesn't make sense still generate that folder. is there a way to specifically tell the pluggin to ignore a workspace or folder? just looking to find an elegant solution.
b

busy-agent-35515

12/01/2023, 2:08 PM
I think config file is what you're looking for: you can ignore certain projects/folders and estimate the rest: https://www.infracost.io/docs/features/config_file/
(and either commit the config file or add it to the gitignore too) 🙂
b

best-action-5428

12/01/2023, 2:30 PM
does this apply to the Vscode plugin ? because I'm not navigating through the terminal so far in that directory.
w

white-airport-8778

12/01/2023, 6:18 PM
@best-action-5428 yep, the vscode extension uses the infracost.yml or infracost.yml.tmpl at the root of your vscode workspace
b

best-action-5428

12/01/2023, 9:39 PM
right and this is located inside the .infracost folder ? because as soon as I add a folder to the workspace the tf folder is added .
w

white-airport-8778

12/01/2023, 9:40 PM
oh no, the infracost.yml file needs to be added to the workspace root (or repo root if you open that folder in VSCode) so you can define your projects: https://github.com/infracost/vscode-infracost/#4-create-a-infracost-config-file
b

best-action-5428

12/01/2023, 9:47 PM
root of the directory where the workspace was created ? could it work independently from any workspace ? if so can the below work ? I have a direcory with many subfolder with oci tf projects : /
Copy code
version: 0.1
exclude_paths:
  - C:\DATA\Cloud\oci
#  - "test-*"
w

white-airport-8778

12/03/2023, 9:03 AM
@best-action-5428 root of the workspace being opened in VSCode, take a look at the “Only matching certain project” example in https://www.infracost.io/docs/features/config_file/#examples as you can specify the paths that should be matched
b

best-action-5428

12/05/2023, 2:15 PM
thanks Ali , we'll check it out . I just don't get if what you mean by workspace root location (is it for each workspace or 1 single location for all )
w

white-airport-8778

12/06/2023, 2:06 PM
Sorry I should have clarified @best-action-5428! When you open a workspace in vscode, whatever folder is the root folder needs to have the infracost.yml config file. It might be easier to do screenshare, DM me if you want 🙂
b

best-action-5428

12/13/2023, 5:38 PM
hehe , I thought the root was a single location in the computer that manages the whole VSCode settings for ifracost . I will just delete the whole infra folder I think since I usually have one config per workspace (I was hopping I could do black list a root path at a VSCODE level). Thank you Ali