Skip to content

fix(updater): check the deploy role recorded at prepare, not DescribeChangeSet - #478

Merged
nambok merged 1 commit into
mainfrom
fix/updater-apply-role-arn
Nov 5, 2026
Merged

nambok merged 1 commit into
mainfrom
fix/updater-apply-role-arn

Conversation

@nambok

@nambok nambok commented Nov 5, 2026

Copy link
Copy Markdown
Collaborator

Summary

Every in-app Confirm and apply of a prepared stack update was refused with "this update was prepared without the deploy role", even when the updater had DEPLOY_ROLE_ARN and the change set was created with RoleARN. Apply read RoleARN from DescribeChangeSet, whose output has no such field (botocore's model lists: Capabilities, ChangeSetId, ChangeSetName, Changes, CreationTime, DeploymentMode, Description, ExecutionStatus, ImportExistingResources, IncludeNestedStacks, NextToken, NotificationARNs, OnStackFailure, Parameters, ParentChangeSetId, RollbackConfiguration, RootChangeSetId, StackDriftStatus, StackId, StackName, Status, StatusReason, Tags). So the check compared None with the role and could never pass. The tests' fake returned RoleARN, which hid it.

Changes

  • native_propose records the role ARN it passes to CreateChangeSet on the update's entry as role_arn (next to the existing apply).
  • New prepared_role(entry): the recorded role; for entries from older updaters with no role_arn, apply: true counts as made with the deploy role (only the role makes apply true).
  • native_apply compares that with DEPLOY_ROLE_ARN and refuses when the entry has no role or a different one. It also checks the described ChangeSetId is the entry's. ExecuteChangeSet already uses the role given at creation.
  • change_set_summary's role flag comes from the entry rather than the missing RoleARN field.
  • Tests: FakeCfn.describe_change_set now asserts it never returns RoleARN (the real shape), and the test setups no longer set it. New tests: a change set prepared with the role applies; an older entry with apply set and no role_arn applies; an entry recording no role or another role is refused; a mismatched change set id is refused.

Verification

  • python3 -m unittest discover -s lambda/tests (the CI Lambda job): 314 tests OK.
  • With main's handler.py and these tests, 6 apply tests in test_updater_native fail ("prepared without the deploy role"), every in-app apply included. That is the failure seen live.

…ChangeSet

DescribeChangeSet's output has no RoleARN field, so apply compared None
with the deploy role and refused every in-app Confirm and apply, even for
change sets created with RoleARN.

Prepare now records the role ARN it passed to CreateChangeSet on the
update's entry (role_arn), and apply compares it with DEPLOY_ROLE_ARN.
Entries from older updaters without role_arn count as made with the role
when apply is set (only the role makes it true). Apply also checks the
described change set id is the entry's. The review summary's role flag
comes from the entry too.

The test fake now refuses to return RoleARN, matching the real API.
@nambok
nambok merged commit b3c9f28 into main Nov 5, 2026
10 checks passed
@nambok
nambok deleted the fix/updater-apply-role-arn branch November 5, 2026 03:05
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