.yasuignore file. This lets you exclude specific Terraform files or directories from cost analysis and PR reports.
Overview
When the Yasu agent analyzes a pull request, it scans for Terraform files (.tf and .tfvars) to estimate cost impacts. In some cases, you may want to exclude certain files — for example, development environment overrides, sandbox configurations, or test fixtures that don’t represent real infrastructure costs.
The .yasuignore file works similarly to .gitignore: you define glob patterns, and any matching files are skipped during analysis.
Setup
The
.yasuignore file only needs to be committed once to your default branch (e.g. main). It will automatically apply to all future PR analyses.Pattern Syntax
The.yasuignore file supports standard glob patterns:
| Pattern | Description |
|---|---|
*.tfvars | Ignore all .tfvars files in any directory |
backend.tf | Ignore a specific file by name |
environments/dev/** | Ignore everything in a directory |
environments/dev/*.tf | Ignore .tf files in a specific directory |
**/test/** | Ignore files in any test directory at any depth |
modules/legacy/** | Ignore an entire module directory |
Comments and blank lines
Lines starting with# are treated as comments. Blank lines are ignored.
Examples
Ignore variable override files
Ignore non-production environments
Ignore legacy or deprecated modules
Ignore test fixtures
How It Works
When a pull request is opened or updated:- Yasu checks for a
.yasuignorefile in the repository - If found, the patterns are parsed and applied to filter out matching files
- Filtered files are excluded from:
- The PR diff analysis
- Infracost cost estimation
- The generated cost report posted as a PR comment
Files excluded by
.yasuignore will not appear in Yasu’s PR cost report at all — they are completely skipped from the analysis pipeline.Supported Platforms
The.yasuignore file works with both supported Git providers:
- GitHub — The file is fetched directly via the GitHub API
- Bitbucket — The file is fetched via the Yasu Bitbucket Forge app
Troubleshooting
My .yasuignore file isn't being picked up
My .yasuignore file isn't being picked up
Ensure the file is:
- Named exactly
.yasuignore(note the leading dot) - Located at the root of the repository (not in a subdirectory)
- Committed to the repository (not just a local file)
- Present on the default branch (
mainormaster)
A pattern isn't matching the files I expect
A pattern isn't matching the files I expect
Patterns use glob syntax with
matchBase enabled, meaning:*.tfvarsmatchesterraform.tfvarsand alsoenvironments/dev/vars.tfvars- For directory-specific matching, use full paths like
environments/dev/*.tf - Use
**for recursive matching across nested directories
I want to temporarily disable .yasuignore
I want to temporarily disable .yasuignore
Comment out all patterns with
# or rename the file. The analysis will process all files as usual when no valid patterns are found.