fix(cost): scope unflagged queries to the profile's AWS account - #1
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
GLASSITY_AWS_ACCOUNT_IDwas read into the profile but never consulted by the cost commands — only--aws-account-idreached 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-idstill wins. Two tests pin the fallback and the flag precedence.Also documents the full headless environment set:
GLASSITY_TOKENalone is not enough — tenant-scoped commands needGLASSITY_ACCOUNT_ID, and cost reads scope toGLASSITY_AWS_ACCOUNT_ID.