https://infracost.io logo
#help
Title
# help
k

kind-angle-62935

02/09/2023, 7:17 PM
Question: If I have a directory structure like:
Copy code
.
└── foo
    ├── bar
    │   ├── <http://bar.tf|bar.tf>
    │   └── bar.tfvars
    ├── <http://main.tf|main.tf>
    └── main.tfvars
How would I configura infracost to find the appropriate tfvars for those?
l

little-author-61621

02/09/2023, 8:04 PM
@kind-angle-62935 does this work for you?
Copy code
version: 0.1
projects:
  - path: .
    terraform_var_files:
      - main.tfvars
  - path: bar
    terraform_var_files:
      - bar.tfvars
k

kind-angle-62935

02/09/2023, 8:09 PM
@little-author-61621 Does that work? Previously I've run into issues where if you have nested paths in projects you get duplicate outputs because each path recursively gets processed.
If the answer isn't obvious, I'll do some testing
l

little-author-61621

02/09/2023, 8:14 PM
yeah I’m sure we had issues with this in the past, but I think it’s been fixed. Not 100% sure though
I ran a quick test case with your example and that config file and it works for me
k

kind-angle-62935

02/09/2023, 8:15 PM
Awesome, thank you @little-author-61621
l

little-author-61621

02/09/2023, 8:18 PM
Yeah i think it might be, but i'd have to check it with a few use cases.
k

kind-angle-62935

02/09/2023, 8:18 PM
Thanks for the quick response
3 Views