StrataFinOps

A StrataBI Platform Module

Powered by Shaleio

Tier: Supported · module id stratafinops · type multi_page_app (an app StrataBI renders from its own pages) · requires StrataBI · stands alone

StrataFinOps gives StrataBI lightweight AWS storage and spend visibility: an S3 storage snapshot and real month-to-date spend from Cost Explorer, as native StrataBI tiles (KPI cards, tables, charts) in standard dashboard cards, with charts drawn in your theme's colors. Each page has one producer Lambda in your account that publishes a snapshot; every tile reads its piece of it. It's deliberately small — a quick read on where storage and money go, not a full FinOps product.

What you get

Open Apps → StrataFinOps. Two tabs:

TabWhat it shows
S3 StorageKPIs (objects, current size, storage classes, last modified), largest top-level prefixes as a chart and a table, and storage classes — a snapshot of current object metadata, not your S3 bill.
AWS CostsKPIs (month to date, billing data through, services), the daily cost chart and cost by service — UnblendedCost from Cost Explorer, cached to avoid repeated billing API calls.

The Snapshot tile says when the data was taken and its scope. Press ▷ on Refresh snapshot to rescan / re-query, then Refresh in the toolbar to reload the tiles. Tables can be downloaded as CSV. If a refresh fails, the previous snapshot stays on screen and the Refresh snapshot tile says why.

Install and update

bash
stratactl install stratafinops          # first install (shows the module terms notice)
stratactl update  stratafinops --to <version>
stratactl uninstall stratafinops

Region, account and the StrataBI system bucket are derived automatically. The install creates two Lambdas with separate least-privilege roles, uploads module.json and llm_context.txt, and registers the module.

Settings

SettingDefaultMeaning
s3_target_bucketsystem bucketThe bucket the S3 Storage page scans.
s3_max_objects2000Scan cap (the Lambda also enforces a ceiling).
cost_modeaccountaccount for the whole account, or tag to scope by a cost-allocation tag.
cost_tag_key / cost_tag_value—The activated cost-allocation tag, in tag mode.
cost_cache_ttl_hours12How long Cost Explorer results are cached (12–24).
s3_snapshot_ttl_minutes60Opening S3 Storage reuses a snapshot younger than this; ▷ always rescans.

Settings live in your StrataCI bucket at config/stratafinops.auto.tfvars.json; change them and run stratactl update stratafinops. See Module settings.

Set up Cost Explorer

The S3 Storage tab works right after install. The AWS Costs tab reads Cost Explorer, which must be turned on for the account once. The install already grants the module's cost_summary role ce:GetCostAndUsage; nothing else needs IAM changes.

Standalone account. As an administrator, open Billing and Cost Management → Cost Explorer once. That enables it. AWS then needs up to 24 hours to prepare the data.

Account in an AWS Organization. Cost Explorer is controlled by the management account:

  1. In the management account, open Billing and Cost Management → Cost Explorer to enable it.
  2. Still in the management account, go to Cost Management preferences, turn on Linked account access, and save. Member accounts can then query their own costs.
  3. Allow up to 24 hours for data to appear in a newly enabled account.

A member account only sees its own spend. To see the whole organization, install StrataFinOps where the management account's data is available.

Check it from the account StrataFinOps runs in. Cost Explorer is always called in us-east-1:

bash
aws ce get-cost-and-usage --region us-east-1 \
  --time-period Start=$(date +%Y-%m-01),End=$(date -d tomorrow +%F) \
  --granularity MONTHLY --metrics UnblendedCost

An amount means it's ready: press ▷ on Refresh snapshot on the AWS Costs tab. "User not enabled for cost explorer access" means step 1 or 2 hasn't taken effect yet.

Scope costs to a tag (optional). Activate the tag as a cost-allocation tag, in the management account for an Organization: Billing → Cost allocation tags, or aws ce update-cost-allocation-tags-status --cost-allocation-tags-status TagKey=<key>,Status=Active. A tag appears there only after resources carry it, and costs are tagged from activation forward. Then set cost_mode=tag, cost_tag_key and cost_tag_value (Module settings) and run stratactl update stratafinops.

AWS bills each Cost Explorer API request. StrataFinOps caches results for cost_cache_ttl_hours, so opening the tab doesn't make a new request each time.

AWS services

Everything below runs in your AWS account. It is created by the install unless noted.

ServiceUsed forRequired
Amazon S3s3_usage lists a single configured bucket (s3:ListBucket only).Yes
Amazon S3Both Lambdas write HTML result artifacts; cost_summary caches CE results under a module prefix.Yes
AWS Cost Explorercost_summary reads real spend from Cost Explorer at us-east-1. Optional — the S3 page works without it.Optional
AWS LambdaThe two module functions, s3_usage and cost_summary.Yes
AWS IAMSeparate least-privilege roles for storage vs billing.Yes
Amazon CloudWatch LogsRuntime logs.Yes

It also uses pieces of your existing StrataBI install: the system S3 bucket, the module registry (DynamoDB) and, for tile results, the <name_prefix>-status-writer Lambda.

How it works

LambdaDoes
s3_usageA bounded ListObjectsV2 scan of the target bucket; writes an HTML snapshot. Its role can list that bucket only — it never reads object contents.
cost_summaryOne grouped Cost Explorer request (us-east-1 endpoint), cached under the module's S3 prefix; writes an HTML report. Only this role has ce:GetCostAndUsage.

Each run publishes a snapshot under runtime/modules/stratafinops/ in the system bucket: the full set is written first and then copied over current/, which the tiles read (CSV for tables and charts, Markdown for KPIs and notes). The producer tile itself follows the standard module tile contract.

Troubleshooting

Modules · Module delivery · StrataCTL