Hello, How can I achieve the cost analysis if I ha...
# help
f
Hello, How can I achieve the cost analysis if I have the following folder structure of TF
Copy code
2-environments
└─ envs                                                                       
    ├─ non-production
    └─ production
I want to run infracost as follow:
infracost breakdown --path=Terraform/envs --usage-file=infracost-config/infracost-usage.yaml
But I only getting this:
Copy code
Evaluating Terraform directory at 2-environments/envs
  ✔ Retrieving cloud prices to calculate costs


 OVERALL TOTAL           -
However, I have another folder with the same structure and it is working fine, it detects the terraform projects within the parent directory
Copy code
❯ infracost breakdown --path=3-networks-hub-and-spoke/envs --usage-file=infracost-config/infracost-usage.yaml
Evaluating Terraform directory at 3-networks-hub-and-spoke/envs
Detected Terraform project at 3-networks-hub-and-spoke/envs/non-production
Detected Terraform project at 3-networks-hub-and-spoke/envs/production
Detected Terraform project at 3-networks-hub-and-spoke/envs/shared
Any help will be appreciated.
b
Hello! Infracost CLI supports config files: https://www.infracost.io/docs/features/config_file/
You can either create a
infracost.yml
file where you specify your projects, or you can generate the config file using a template: https://www.infracost.io/docs/features/config_file/#dynamic-config-files
f
ok, I'll try using `infracost.yaml`file. Thanks!