Skip to content

Configuration Reference

FinFocus is configured via a configuration file (default: ~/.finfocus/config.yaml) and environment variables.

The configuration file is in YAML format.

output:
default_format: table # table, json, ndjson
precision: 2
logging:
level: info # debug, info, warn, error
plugin_dir: ~/.finfocus/plugins

FinFocus uses a two-tier configuration system where project-local settings override user-global defaults.

TierLocationPurpose
Project-local$PULUMI_PROJECT/.finfocus/config.yamlProject-specific budgets, output preferences, plugin config
User-global~/.finfocus/config.yamlShared defaults across all projects

When a Pulumi project is detected, FinFocus creates a .finfocus/ directory alongside Pulumi.yaml:

my-pulumi-project/
├── Pulumi.yaml
├── .finfocus/
│ ├── .gitignore # Auto-generated, protects user-specific data
│ ├── config.yaml # Project budgets, output prefs
│ └── dismissed.json # Per-project recommendation dismissals

Project-specific settings (config, dismissals) are resolved in this order:

  1. --project-dir flag (explicit override)
  2. FINFOCUS_PROJECT_DIR environment variable
  3. Walk up from CWD to find Pulumi.yaml, then use $PROJECT/.finfocus/
  4. Fall back to ~/.finfocus/ (backward compatible)

Global resources (plugins, cache, logs) are resolved separately:

  1. FINFOCUS_HOME environment variable
  2. PULUMI_HOME/finfocus
  3. ~/.finfocus/

Project config.yaml overrides global config.yaml at the top-level key level (shallow merge). Keys absent in the project config inherit from global defaults.

For example, if the global config defines output and logging sections, and the project config only defines output, the project output section replaces the global one entirely while logging is inherited from the global config.

# ~/.finfocus/config.yaml (global)
output:
default_format: table
precision: 2
logging:
level: info
# my-project/.finfocus/config.yaml (project)
output:
default_format: json
precision: 4
# Effective config: output from project, logging from global
  • default_format: The default output format for commands.
  • precision: Number of decimal places for cost values.
  • level: The verbosity of logs.
  • plugin_dir: Top-level key that overrides the computed plugin installation directory. Equivalent to setting the FINFOCUS_PLUGIN_DIR environment variable (env var takes precedence). Example: plugin_dir: /opt/finfocus/plugins

Configure the BoltDB-backed cost calculation cache.

  • enabled: Master switch for caching. Set to true to enable. Default: false.
  • ttl_seconds: Seconds until a cached entry expires. 0 disables expiration. Default: 3600 (1 hour).
  • directory: Explicit path for the cache database file. When empty, auto-resolves to the project .finfocus/ directory or ~/.finfocus/cache/.

Configure the BoltDB-backed resource history store that tracks cloud resource identity across replacements and deletions. The history store enables accurate full-month cost reporting by remembering all cloud IDs a resource has ever had.

Important: Unlike the cache, the history database contains persistent data that cannot be regenerated. Deleting history.db causes accuracy degradation for past billing periods.

OptionTypeDefaultEnv VarDescription
cost.history.enabledbooltrueFINFOCUS_HISTORY_ENABLEDMaster switch for resource history tracking. When disabled, all history operations are no-ops and commands fall back to current-state-only behavior.
cost.history.retention_daysint90FINFOCUS_HISTORY_RETENTION_DAYSDays before stale entries are removed. Entries with LastSeen older than this window are cleaned up on startup.
cost.history.directorystring~/.finfocus/historyFINFOCUS_HISTORY_DIROverride the history database directory. When empty, auto-resolves to ~/.finfocus/history/.
cost:
history:
enabled: true
retention_days: 90
directory: "" # uses default ~/.finfocus/history

Configure tag-based cost attribution for resources that lack direct billing identity. This is a Layer 2 feature — the configuration is validated and stored, but the tag-based query logic is deferred to a future milestone.

OptionTypeDefaultDescription
cost.allocation.enabledboolfalseWill enable tag-based cost attribution fallback. The configuration is validated and stored now; tag-based query logic will be applied in a future milestone.
cost.allocation.tagsstring list[]Tag keys that will be used for billing API queries (e.g., pulumi:project, aws:createdBy). Each key must be non-empty and at most 128 characters. Validated on load but not yet applied for attribution.
cost:
allocation:
enabled: true
tags:
- "pulumi:project"
- "aws:createdBy"
- "team"

Configure budget limits, alerts, and cost calculation preferences.

The cost.budgets section supports hierarchical scoping with global, providers, tags, and types sections.

Global budget applied to all resources.

OptionTypeDefaultDescription
amountnumber-Required. The budget limit amount.
currencystringUSDISO 4217 currency code.
periodstringmonthlyBudget period (daily, weekly, monthly, yearly).
alertslist[]List of alert definitions.
exit_on_thresholdbooleanfalseWhether to exit CI/CD when the budget threshold is reached (global and per-scope).
exit_codenumber2Exit code when budget exceeded (CI/CD integration).

Per-provider budgets for multi-cloud cost control.

OptionTypeDefaultDescription
<provider>object-Provider name (aws, gcp, azure) with budget settings.
<provider>.amountnumber-Required. Provider budget limit.
<provider>.currencystringGlobal currencyMust match global budget currency.

Tag-based budgets for team/project cost allocation.

OptionTypeDefaultDescription
selectorstring-Required. Tag pattern (key:value or key:*).
prioritynumber0Priority for overlapping tags (higher wins).
amountnumber-Required. Tag budget limit.
currencystringGlobal currencyMust match global budget currency.

Per-resource-type budgets for category control.

OptionTypeDefaultDescription
<type>object-Resource type (e.g., aws:ec2/instance) with budget settings.
<type>.amountnumber-Required. Type budget limit.
<type>.currencystringGlobal currencyMust match global budget currency.
OptionTypeDefaultDescription
thresholdnumber-Required. Percentage of budget (1-100) to trigger alert.
typestringactualTrigger on actual (historical) or forecasted (projected) cost.
cost:
budgets:
global:
amount: 10000.00
currency: USD
period: monthly
exit_code: 2
alerts:
- threshold: 80
type: actual
providers:
aws:
amount: 5000.00
gcp:
amount: 3000.00
tags:
- selector: 'team:platform'
priority: 100
amount: 3000.00
- selector: 'env:prod'
priority: 50
amount: 5000.00
types:
'aws:ec2/instance':
amount: 2000.00
'aws:rds/instance':
amount: 3000.00

See Budget Configuration Guide for detailed usage.

For IDE autocompletion (VS Code, JetBrains), add this comment to the top of your config.yaml:

# yaml-language-server: $schema=https://rshade.github.io/finfocus/schemas/config.json