forked from github/pre-commit-opentofu
docs: Document --terraform-plan-flags usage limitations for infracost (#364)
This commit is contained in:
parent
ee8c60e300
commit
f1822ed810
1 changed files with 12 additions and 2 deletions
14
README.md
14
README.md
|
|
@ -299,7 +299,17 @@ Unlike most other hooks, this hook triggers once if there are any changed files
|
|||
<!-- markdownlint-disable-next-line no-inline-html -->
|
||||
</details>
|
||||
|
||||
2. (Optionally) Define `cost constrains` the hook should evaluate successfully in order to pass:
|
||||
2. Note that there can be a maximum of one flag inside `--terraform-plan-flags`. Split into several `--args` to avoid using spaces in `--terraform-plan-flags`. Example of right usage:
|
||||
|
||||
```yaml
|
||||
- id: infracost_breakdown
|
||||
args:
|
||||
- --args=--path=./env/dev
|
||||
- --args=--terraform-plan-flags="-var-file=terraform.tfvars"
|
||||
- --args=--terraform-plan-flags="-var-file=../terraform.tfvars"
|
||||
```
|
||||
|
||||
3. (Optionally) Define `cost constrains` the hook should evaluate successfully in order to pass:
|
||||
|
||||
```yaml
|
||||
- id: infracost_breakdown
|
||||
|
|
@ -346,7 +356,7 @@ Unlike most other hooks, this hook triggers once if there are any changed files
|
|||
* `.diffTotalHourlyCost` (for Infracost version 0.9.12 or newer) or `[.projects[].diff.totalMonthlyCost | select (.!=null) | tonumber] | add` (for Infracost older than 0.9.12)
|
||||
* To disable hook color output, set `PRE_COMMIT_COLOR=never` env var.
|
||||
|
||||
3. **Docker usage**. In `docker build` or `docker run` command:
|
||||
4. **Docker usage**. In `docker build` or `docker run` command:
|
||||
* You need to provide [Infracost API key](https://www.infracost.io/docs/integrations/environment_variables/#infracost_api_key) via `-e INFRACOST_API_KEY=<your token>`. By default, it is saved in `~/.config/infracost/credentials.yml`
|
||||
* Set `-e INFRACOST_SKIP_UPDATE_CHECK=true` to [skip the Infracost update check](https://www.infracost.io/docs/integrations/environment_variables/#infracost_skip_update_check) if you use this hook as part of your CI/CD pipeline.
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue