Skip to content

Analyzer Setup

FinFocus integrates with Pulumi’s analyzer framework as a Policy Pack. This allows you to see real-time cost estimates directly within your pulumi preview and pulumi up workflow.

  • Pulumi CLI installed
  • finfocus binary built (run make build)

finfocus analyzer install creates the policy pack at ~/.finfocus/analyzer. The directory holds:

  • PulumiPolicy.yaml
  • pulumi-analyzer-policy-finfocus, which Pulumi before 3.270.0 starts
  • pulumi-language-finfocus, which Pulumi 3.270.0 and later starts

On Windows both entries end in .exe.

Terminal window
finfocus analyzer install

An existing pack that has only pulumi-analyzer-policy-finfocus is updated by running finfocus analyzer install again.

The pack directory must be on your PATH, and the preview must point at that directory. Pulumi 3.270.0 and later starts pulumi-language-finfocus from PATH. Older releases start pulumi-analyzer-policy-finfocus the same way.

Section titled “Option A: CLI Flag (Recommended for testing)”
Terminal window
export PATH="${HOME}/.finfocus/analyzer:${PATH}"
pulumi preview --policy-pack ~/.finfocus/analyzer
Section titled “Option B: Environment Variable (Recommended for CI/CD)”
Terminal window
export PATH="${HOME}/.finfocus/analyzer:${PATH}"
export PULUMI_POLICY_PACK_PATH="$HOME/.finfocus/analyzer"
pulumi preview

Once configured, cost estimates will appear as advisory diagnostics in your Pulumi output:

Policies:
finfocus@v0.3.0 (local: ~/.finfocus/analyzer)
- [advisory] [severity: low] cost-estimate (aws:ec2/instance:Instance: my-instance)
Estimated Monthly Cost: $7.50 USD (source: finfocus-plugin-aws)
- [advisory] [severity: low] stack-cost-summary (pulumi:pulumi:Stack: my-stack)
Total Estimated Monthly Cost: $7.50 USD (1 resources analyzed)

A resource the plugin prices as spot adds its spot label after the cost line, for example Estimated Monthly Cost: $21.90 USD (source: finfocus-plugin-aws) | SPOT · risk 0.12 · -62% vs on-demand.

no language plugin ‘pulumi-language-finfocus’

Section titled “no language plugin ‘pulumi-language-finfocus’”

Pulumi 3.270.0 and later fails the preview when the language plugin entry is missing:

no language plugin 'pulumi-language-finfocus' found in the workspace or on your $PATH

Pulumi may also print a 404 while looking up a download named pulumi-finfocus (could not find latest version). Re-run finfocus analyzer install and keep ~/.finfocus/analyzer on PATH.

Ensure:

  1. ~/.finfocus/analyzer/ contains PulumiPolicy.yaml, pulumi-analyzer-policy-finfocus, and pulumi-language-finfocus (both binaries end in .exe on Windows).
  2. The directory is on your PATH: export PATH="${HOME}/.finfocus/analyzer:${PATH}". Pulumi searches PATH for the entry it starts. Placing the files only in the policy pack directory is not sufficient.
  1. Verify that PulumiPolicy.yaml exists in the same directory as the binary.

  2. Ensure you are passing the correct path to --policy-pack.

  3. Check logs by enabling debug mode:

    Terminal window
    FINFOCUS_LOG_LEVEL=debug pulumi preview --policy-pack ~/.finfocus/analyzer

For a deep dive into how the analyzer works, see the Analyzer Integration Guide.