Include AWS account ID in drift plan files#21
Merged
Conversation
The apply and detect-drift workflows wrote a drift.plan.json containing only the deployed SHA and a drift flag. Because we deploy the same SHA to every environment via a matrix, the resulting files were byte-for-byte identical across environments and therefore shared a fingerprint. Kosli treats same-fingerprint artifacts as the same artifact, so Environment snapshots reported a single arbitrarily-chosen drift file as deployed everywhere, producing confusing Slack and UI messages. Add the AWS account ID (already looked up when computing the state bucket name) as an extra key so each environment's drift plan is unique and gets a distinct fingerprint. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
pbeckham
approved these changes
Jun 23, 2026
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.
What
Add the AWS account ID to the
drift.plan.jsonfile generated by the drift-detection workflows.Why
We deploy one specific commit SHA to every environment via a matrix, so the drift plan files —
which only contained
{ sha, drift }— were byte-for-byte identical across environments andtherefore shared a fingerprint. Kosli treats same-fingerprint artifacts as the same artifact, so
Environment snapshots reported one arbitrarily-chosen drift file as deployed everywhere, producing
confusing messages in Slack and the Kosli UI.
Including the AWS account ID makes each environment's drift plan unique, so each gets a distinct
fingerprint. The account ID is already looked up when computing the state bucket name, so it is
reused via
$GITHUB_ENVrather than adding anotheraws stscall.Changes
apply.yml(reset-drift-detection) — exportAWS_ACCOUNT_IDand addaws_account_idto thecreated drift plan.
detect-drift.yml(flag-drift) — same change, keeping both files' JSON shape consistent.The new shape:
{ "sha": "<sha>", "drift": false, "aws_account_id": "<account-id>" }Addresses kosli-dev/terraform-server#466
🤖 Generated with Claude Code