Hi Infracost Team, I am currently facing an issue ...
# help
c
Hi Infracost Team, I am currently facing an issue with the few project cost. Specifically, some environments such as
qa2
and
staging2
are not being detected. Can I configure the autodetect in usgae file eg below:-
Copy code
version: 0.1
resource_type_default_usage:
  azurerm_app_configuration:
    monthly_additional_requests: 1666666
autodetect:
  env_names:
    - dev
    - qa*
    - staging*
    - prod
    - dr
b
Hello! Yes, this is supported, however you should wrap them in double quotes:
- "qa*"
. See here https://www.infracost.io/docs/features/config_file/#auto-detect-parameters
Ah, sorry, you mentioned that's a usage file. Instead, please define the env names in the config file
infracost.yml
The config file is responsible for detecting the repo structure, and the usage file is responsible for usage based resources
c
but config and usage file can not passed together.
--config-file string  | Path to Infracost config file. Cannot be used with path, terraform* or usage-file flags
What are the alternative when I need both below is my command.
infracost breakdown --path=. --format=json --out-file=/tmp/infracost.json --usage-file ${{ parameters.infracostUsageFile }} --log-level ${{ parameters.infracostLogLevel }}
b
You can specify
usage_file
in the config file
You can also use a config template if you have dynamic values, but this will require an extra step to generate the config file: https://www.infracost.io/docs/features/config_file/#advanced-config-template-syntax
w
@clean-jackal-84980 we recommend using our Source Control Integrations as that way you don’t need to worry about running CLI commands, and they work with all Infracost Cloud features. I’ll drop you a quick email