Skip to content

fix(cost): scope unflagged queries to the profile's AWS account - #1

Merged
davidemerli merged 2 commits into
mainfrom
fix/cost-account-scoping
Aug 13, 2026
Merged

fix(cost): scope unflagged queries to the profile's AWS account#1
davidemerli merged 2 commits into
mainfrom
fix/cost-account-scoping

Conversation

@davidemerli

Copy link
Copy Markdown
Member

GLASSITY_AWS_ACCOUNT_ID was read into the profile but never consulted by the cost commands — only --aws-account-id reached the request, so an unflagged query silently fell back to whatever account the server treats as the default. In an agent context that reads as "this tenant has no cost data" whenever the default account happens to be empty.

Cost commands now fall back to the profile's account when the flag is absent; an explicit --aws-account-id still wins. Two tests pin the fallback and the flag precedence.

Also documents the full headless environment set: GLASSITY_TOKEN alone is not enough — tenant-scoped commands need GLASSITY_ACCOUNT_ID, and cost reads scope to GLASSITY_AWS_ACCOUNT_ID.

GLASSITY_AWS_ACCOUNT_ID was read into the profile but never consulted by
the cost commands — only --aws-account-id reached the request, so an
unflagged query silently fell back to whatever account the server treats
as the default. In an agent context that reads as "this tenant has no
cost data" whenever the default account happens to be empty.

Cost commands now fall back to the profile's account when the flag is
absent; an explicit --aws-account-id still wins. Two tests pin the
fallback and the flag precedence.
The Headless and CI section said GLASSITY_TOKEN alone was enough. It is
not: every tenant-scoped command then fails with "no active tenant"
until GLASSITY_ACCOUNT_ID is exported too, and cost reads scope to
GLASSITY_AWS_ACCOUNT_ID unless --aws-account-id is passed. The README
example now exports all three, and the configuration reference says when
the two account variables matter.
@davidemerli
davidemerli merged commit a66cc08 into main Aug 13, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant