Repository navigation
fix(sns): forward CloudFormation subscription roles - #7683
Conversation
PR Summary by QodoForward CloudFormation SNS subscription roles on create and update
AI Description
Diagram
High-Level Assessment
Files changed (4)
|
Code Review by Qodo
1.
|
|
Floci's Java package moved from git fetch origin
bash <(git show origin/main:tools/rename/rebase_across_rename.sh) <your-branch>The script applies the same rename to your branch and replays your change onto the new git push --force-with-lease origin <your-branch>It needs only git, bash and python3 (on Windows, Git Bash or WSL). If it stops on a conflict, or anything looks off, reply here and we will help. More context in https://github.com/orgs/floci-io/discussions/6590. |
Resolve SubscriptionRoleArn for SNS subscriptions and update the role without replacing the subscription. Remove the covered CloudFormation property gap. Validate RawMessageDelivery and FilterPolicy when Subscribe reuses an existing subscription; preserve omitted/default attributes and explicit updates. Signed-off-by: Andre Kurait <akurait@amazon.com>
8a35def to
20e6fef
Compare
|
Rebased across the namespace migration in 20e6fef, preserving all four original feature files after exact package replacement and the original message/DCO. The source-backed Subscribe reuse follow-up now rejects conflicting raw delivery and filter policies without mutating the existing subscription; explicit updates remain supported. Fresh 224 affected tests, package, full Checkstyle and repository gates pass. The separate Firehose role/PassRole/removal proof limits remain open. |
pgermosen
left a comment
There was a problem hiding this comment.
@AndreKurait thanks, the role now reaches SNS on create and update. It's not quite ready yet, though.
As far as I can tell, the new check in subscribe also meets CloudFormation's own updates. FilterPolicy and RawMessageDelivery update in place, and provisionSubscription sends an update through subscribe, which finds the stack's own subscription with the old values and now refuses it. So an UpdateStack that changes either one fails, where it used to succeed without applying the change. Could the update set the changed attributes on the existing subscription, as it now does for the role, with a test that updates FilterPolicy?
Update the stack subscription by its prior physical identity when topic, protocol and endpoint are unchanged. Preserve Subscribe validation for creates and target replacements, reset dropped declared attributes and validate firehose roles before other attribute writes. Cover FilterPolicy and raw delivery updates/removal through CloudFormation and SNS SDKs. Signed-off-by: Andre Kurait <AndreKurait@gmail.com>
|
@pgermosen Fixed in 56bc16f. Updates now use the prior subscription ARN when topic, protocol and endpoint are unchanged, then apply the mutable attributes through SetSubscriptionAttributes. Creates and target replacements retain Subscribe validation. Dropped declared policies/raw delivery are reset; attributes never declared by the stack are preserved, and firehose role validation precedes other writes. The new CloudFormation/SNS SDK regression changes FilterPolicy and RawMessageDelivery, removes them, and asserts the same subscription ARN throughout. With the exact original provisioner it reaches UPDATE_ROLLBACK_COMPLETE; the fixed version passes. Validation: Java 25 clean package and full Checkstyle, 253 tests across 10 affected SNS/CloudFormation classes with zero failures/errors/skips, plus five static gates. The exact old-source control set fails six of nine cases with three positives; all nine pass on the fixed source. This is local SDK/service coverage, not live AWS or native qualification. Replacement CI remains separate. |
pgermosen
left a comment
There was a problem hiding this comment.
@AndreKurait thanks, an update on the same topic, protocol and endpoint now sets the changed attributes on the stack's own subscription and resets the ones it dropped, so FilterPolicy and RawMessageDelivery updates apply in place instead of meeting the new Subscribe check.
|
🎉 This PR is included in version 2.5.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Summary
Fixes #7672. CloudFormation now resolves and forwards
SubscriptionRoleArnwhen creating anAWS::SNS::Subscription. Role updates use the existing SNS attribute operation and preserve the subscription ARN. Removes the corresponding writable-property gap.Type of change
fix:)AWS Compatibility
CloudFormation documents
SubscriptionRoleArnfor Firehose subscriptions with no-interruption updates. The SDK regression creates a subscription with an intrinsic role ARN, changes the role, and checks attribute readback and unchanged subscription identity. Unit coverage also preserves explicit-null omission. This does not claim general property-removal semantics or Firehose delivery authorization.Fresh Java 25 qualification: 163 tests across four classes, zero failures, errors or skips; clean package, full Checkstyle and five repository gates pass. Includes the SNS service, provisioner, CloudFormation SDK regression and schema coverage. Retained prior unchanged-production controls fail the two new create/update regressions, with 144 existing positives. Those controls were not repeated because the affected source is unchanged.
Retained prior AWS comparison covered create and role update in two regions, preserving subscription identity; fourteen owned resources and two stacks were deleted and verified absent. That prior comparison was not reexecuted for publication. No native, Firehose delivery, full repository suite or complete dev-graph qualification claim.
Checklist
Current Signer and ECS contributor changes touch different rows of the shared property-gap inventory.
Namespace and subscription-reuse follow-up
Rebased on
7cf443fcee499f707453990099b9e0442aab72d7using the maintainer package migration tool. All four original feature files are preserved byte-for-byte after package replacement; the original message and DCO remain.Repeated Subscribe now rejects conflicting RawMessageDelivery and FilterPolicy while preserving the existing subscription. Nonempty filter-policy strings compare exactly, including whitespace and ordering. Omission, observed empty/default values, ignored FilterPolicyScope changes and explicit attribute updates retain their behavior. This does not silently assign a different Firehose role during initial reuse.
Fresh Java 25 qualification at tree
61108e85d8479b9a1f0201e37a2bc23a237874a4: 224 tests across 8 SNS and CloudFormation classes, zero failures/errors/skips. Package, full Checkstyle and five repository gates pass. SDK Query and JSON conflict/state-preservation controls cover the combined source. Against the exact old SNS service, the regression control has 10 assertion failures and two positives, zero errors or skips. The prior separate 14 local SDK and 34 AWS Subscribe controls remain scoped evidence, not new execution in this rebase. No role-equality/removal, captured CloudFormation execution identity/PassRole, delivery, native-image or full-suite proof is claimed.