Skip to content

Core Concepts

This page explains the fundamental concepts and terminology used throughout FinFocus.

A Resource Descriptor is the internal representation of a cloud resource that FinFocus uses for cost calculations. It contains:

  • Provider: The cloud provider (e.g., aws, azure, gcp)
  • Type: The resource type in Pulumi format (e.g., aws:ec2/instance:Instance)
  • SKU: The specific SKU or instance type (e.g., t3.xlarge)
  • Region: The deployment region (e.g., us-east-1)
  • Inputs: Key-value pairs of resource properties from Pulumi state
{
"provider": "aws",
"type": "aws:ec2/instance:Instance",
"sku": "t3.xlarge",
"region": "us-east-1",
"inputs": {
"instanceType": "t3.xlarge",
"availabilityZone": "us-east-1a"
}
}

FinFocus supports two types of cost calculations:

Projected costs are estimates based on infrastructure definitions before deployment. They answer the question: “How much will this infrastructure cost?”

  • Calculated from pulumi preview --json output
  • Uses public pricing APIs or local pricing specifications
  • Ideal for budget planning and cost estimation

Actual costs are real historical spending data from cloud providers. They answer the question: “How much did this infrastructure actually cost?”

  • Retrieved from cost management APIs (AWS Cost Explorer, Azure Cost Management)
  • Supports time ranges and grouping options
  • Ideal for cost tracking and analysis

FinFocus uses a plugin-based architecture to support multiple cost data sources.

  1. Discovery: FinFocus scans ~/.finfocus/plugins/ for installed plugins
  2. Launch: When a resource matches a plugin’s provider, the plugin is started
  3. Communication: FinFocus communicates with plugins via gRPC
  4. Fallback: If no plugin handles a resource, local YAML specs are used
TypeDescriptionExample
Cost PluginsQuery cloud provider pricing APIsAWS Public, AWS Cost Explorer
Spec FilesLocal YAML/JSON pricing specificationsCustom pricing data

For each resource, FinFocus:

  1. Identifies the provider from the resource type
  2. Checks if a plugin supports that provider
  3. Sends the resource descriptor to the plugin
  4. Receives cost data or falls back to local specs
┌─────────────────┐
│ Pulumi JSON │
│ (preview/state) │
└────────┬────────┘
┌─────────────────┐
│ Ingestion │
│ (Parse JSON) │
└────────┬────────┘
┌─────────────────┐
│ Resource │
│ Descriptors │
└────────┬────────┘
┌─────────────────┐
│ Engine │◄───── Plugins (gRPC)
│ (Orchestrate) │◄───── Local Specs (YAML)
└────────┬────────┘
┌─────────────────┐
│ Cost Results │
│ (Aggregate) │
└────────┬────────┘
┌─────────────────┐
│ Output │
│ (Table/JSON) │
└─────────────────┘

FinFocus supports various ways to aggregate and group cost data:

OptionDescription
resourceGroup by individual resource
typeGroup by resource type
providerGroup by cloud provider
dateGroup by date (for actual costs)
Terminal window
finfocus cost projected --pulumi-json plan.json --group-by type

Output:

TYPE MONTHLY CURRENCY
aws:ec2/instance:Instance $750.00 USD
aws:s3/bucket:Bucket $5.00 USD
aws:rds/instance:Instance $200.00 USD

FinFocus supports budget enforcement with configurable thresholds.

Budgets are configured in ~/.finfocus/config.yaml:

cost:
budgets:
amount: 500.00
currency: USD
alerts:
- threshold: 80
type: actual
- threshold: 100
type: forecasted

Budgets can be scoped to specific resources:

ScopeDescriptionExample
globalAll resourcesDefault
provider:<name>By cloud providerprovider:aws
tag:<key>=<value>By resource tagtag:env=prod
type:<resource-type>By resource typetype:aws:ec2/instance

FinFocus supports multiple output formats:

FormatUse Case
tableHuman-readable terminal output (default)
jsonAPI integration and programmatic access
ndjsonStreaming and pipeline processing