Skip to content

fix(cli): filter benign time-relative AppSync ApiKey /Expires drift - #14991

Merged
sarayev merged 1 commit into
devfrom
fix/drift-apikey-expires-time-relative
Sep 30, 2026
Merged

sarayev merged 1 commit into
devfrom
fix/drift-apikey-expires-time-relative

Conversation

@sarayev

@sarayev sarayev commented Sep 29, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds a false-positive filter for AppSync ApiKey /Expires drift during Gen2 migration drift detection.

An AppSync ApiKey Expires value is set to createTime + validity at deploy time, and then re-derived at a later lock time when drift is computed. Because the two epoch timestamps are computed at different moments, they legitimately differ, so CloudFormation reports a drift that is not a real configuration change. A real observed pair from the migration e2e runs was Expected 1791274802 vs Deployed 1.7912736E+9 (a benign delta of roughly 20 minutes; note the deployed value also comes back in scientific notation).

The new isAppSyncApiKeyExpiresTimeRelativeDrift filter drops this specific case. It is guarded so it only ever fires on AWS::AppSync::ApiKey resources, only on the /Expires property path, and only when both the expected and actual values parse as epoch-like numbers (finite and greater than roughly the year 2020). Those guards mean the filter cannot mask a non-timestamp mutation or any change to a different property.

Why this is not a source regression

The drift-detection code is unchanged between July and now. This surfaced because CloudFormation's drift output began reporting the time-relative /Expires difference, not because any code changed.

Impact

Clears the 7 gen2_migration e2e groups that were failing on /Expires drift.

Testing

packages/amplify-cli drift unit tests pass 12/12, including four new cases covering the real CI pair, a plain-integer epoch pair, non-epoch and non-numeric values (not filtered), and wrong resource type / wrong property path (not filtered).

AppSync ApiKey /Expires is set to createTime+validity at deploy and re-derived later at lock time, so the two epoch timestamps legitimately differ. Drop it as a false positive, guarded so it only ever drops epoch-like values (both parse as epoch > ~2020) and cannot mask a non-timestamp mutation.
@sarayev
sarayev marked this pull request as ready for review September 30, 2026 05:54
@sarayev
sarayev requested a review from a team as a code owner September 30, 2026 05:54
@sarayev
sarayev merged commit ca69bd9 into dev Sep 30, 2026
5 checks passed
@sarayev
sarayev deleted the fix/drift-apikey-expires-time-relative branch September 30, 2026 08:40
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.

2 participants