broad-zoo-34077
02/07/2022, 10:46 PMwhite-airport-8778
# infracost.yml
version: 0.1
projects:
- path: dev
env:
AWS_PROFILE: infracost-dev
- path: prod
env:
AWS_PROFILE: infracost-prod
2. Run with `--config-file`:
- id: infracost_breakdown
args:
- --args=--config-file=/path/to/infracost.yml
loud-optician-49310
02/07/2022, 10:59 PMloud-optician-49310
02/07/2022, 11:17 PM# infracost.yml
version: 0.1
projects:
- path: workspace/ops/stg/
env:
AWS_PROFILE: stg
- path: workspace/ops/prod/
env:
AWS_PROFILE: prod
loud-optician-49310
02/07/2022, 11:17 PMloud-optician-49310
02/07/2022, 11:18 PMloud-optician-49310
02/07/2022, 11:24 PM- id: infracost_breakdown
args:
- --args=--path=./env/dev
verbose: true # Always show costs
loud-optician-49310
02/07/2022, 11:24 PMwhite-airport-8778
loud-optician-49310
02/08/2022, 12:32 AMwhite-airport-8778
# workspace/ops/stg/infracost.yml
version: 0.1
projects:
- path: .
env:
AWS_PROFILE: stg
prod:
# workspace/ops/prod/infracost.yml
version: 0.1
projects:
- path: .
env:
AWS_PROFILE: prod
Then in pre-commit, you can then use their magic __GIT_WORKING_DIR__
option:
- --args=--config-file=__GIT_WORKING_DIR__/infracost.yml
Would that be any better?loud-optician-49310
02/08/2022, 5:10 PMloud-optician-49310
02/08/2022, 5:24 PMloud-optician-49310
02/08/2022, 5:33 PMwhite-airport-8778