-
Notifications
You must be signed in to change notification settings - Fork 9.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ensure correct SNS Subscription Filter Policy Scope update order #28572
Ensure correct SNS Subscription Filter Policy Scope update order #28572
Conversation
Community NoteVoting for Prioritization
For Submitters
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Welcome @DanielVZ96 👋
It looks like this is your first Pull Request submission to the Terraform AWS Provider! If you haven’t already done so please make sure you have checked out our CONTRIBUTOR guide and FAQ to make sure your contribution is adhering to best practice and has all the necessary elements in place for a successful approval.
Also take a look at our FAQ which details how we prioritize Pull Requests for inclusion.
Thanks again, and welcome to the community! 😃
I'm unable to pay for Acc tests. If someone could help me with that, it would be much appreciated! |
Hi, @DanielVZ96! I've already created a PR for this. However, it seems like it's not a high priority issue. I guess if we could create an issue and link it in our PRs it might get more interactions from other users and we will get more attention |
@vasiliyparfenov ohh sorry I didn't notice! our approaches are a bit different so let's wait for reviews. There are plenty of PRs already open. Since PRs are prioritized by the number of 👍 s we should get the most we can to prioritize this. I'll try to get some for both PRs. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🚀.
% make testacc TESTARGS='-run=TestAccSNSTopicSubscription_' PKG=sns ACCTEST_PARALLELISM=3
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/sns/... -v -count 1 -parallel 3 -run=TestAccSNSTopicSubscription_ -timeout 180m
=== RUN TestAccSNSTopicSubscription_basic
=== PAUSE TestAccSNSTopicSubscription_basic
=== RUN TestAccSNSTopicSubscription_filterPolicy
=== PAUSE TestAccSNSTopicSubscription_filterPolicy
=== RUN TestAccSNSTopicSubscription_filterPolicyScope
=== PAUSE TestAccSNSTopicSubscription_filterPolicyScope
=== RUN TestAccSNSTopicSubscription_filterPolicyScope_policyNotSet
=== PAUSE TestAccSNSTopicSubscription_filterPolicyScope_policyNotSet
=== RUN TestAccSNSTopicSubscription_deliveryPolicy
=== PAUSE TestAccSNSTopicSubscription_deliveryPolicy
=== RUN TestAccSNSTopicSubscription_redrivePolicy
=== PAUSE TestAccSNSTopicSubscription_redrivePolicy
=== RUN TestAccSNSTopicSubscription_rawMessageDelivery
=== PAUSE TestAccSNSTopicSubscription_rawMessageDelivery
=== RUN TestAccSNSTopicSubscription_autoConfirmingEndpoint
=== PAUSE TestAccSNSTopicSubscription_autoConfirmingEndpoint
=== RUN TestAccSNSTopicSubscription_autoConfirmingSecuredEndpoint
=== PAUSE TestAccSNSTopicSubscription_autoConfirmingSecuredEndpoint
=== RUN TestAccSNSTopicSubscription_email
=== PAUSE TestAccSNSTopicSubscription_email
=== RUN TestAccSNSTopicSubscription_firehose
=== PAUSE TestAccSNSTopicSubscription_firehose
=== RUN TestAccSNSTopicSubscription_disappears
=== PAUSE TestAccSNSTopicSubscription_disappears
=== RUN TestAccSNSTopicSubscription_Disappears_topic
=== PAUSE TestAccSNSTopicSubscription_Disappears_topic
=== CONT TestAccSNSTopicSubscription_basic
=== CONT TestAccSNSTopicSubscription_autoConfirmingEndpoint
=== CONT TestAccSNSTopicSubscription_firehose
--- PASS: TestAccSNSTopicSubscription_autoConfirmingEndpoint (84.40s)
=== CONT TestAccSNSTopicSubscription_Disappears_topic
--- PASS: TestAccSNSTopicSubscription_basic (93.62s)
=== CONT TestAccSNSTopicSubscription_disappears
--- PASS: TestAccSNSTopicSubscription_Disappears_topic (99.74s)
=== CONT TestAccSNSTopicSubscription_email
--- PASS: TestAccSNSTopicSubscription_disappears (98.02s)
=== CONT TestAccSNSTopicSubscription_deliveryPolicy
--- PASS: TestAccSNSTopicSubscription_email (15.07s)
=== CONT TestAccSNSTopicSubscription_rawMessageDelivery
--- PASS: TestAccSNSTopicSubscription_firehose (277.61s)
=== CONT TestAccSNSTopicSubscription_redrivePolicy
--- PASS: TestAccSNSTopicSubscription_deliveryPolicy (93.06s)
=== CONT TestAccSNSTopicSubscription_filterPolicyScope
--- PASS: TestAccSNSTopicSubscription_rawMessageDelivery (90.82s)
=== CONT TestAccSNSTopicSubscription_filterPolicyScope_policyNotSet
--- PASS: TestAccSNSTopicSubscription_filterPolicyScope_policyNotSet (1.95s)
=== CONT TestAccSNSTopicSubscription_autoConfirmingSecuredEndpoint
--- PASS: TestAccSNSTopicSubscription_autoConfirmingSecuredEndpoint (92.58s)
=== CONT TestAccSNSTopicSubscription_filterPolicy
--- PASS: TestAccSNSTopicSubscription_filterPolicyScope (182.75s)
--- PASS: TestAccSNSTopicSubscription_redrivePolicy (138.88s)
--- PASS: TestAccSNSTopicSubscription_filterPolicy (96.23s)
PASS
ok github.com/hashicorp/terraform-provider-aws/internal/service/sns 485.931s
@DanielVZ96 @vasiliyparfenov Thanks for the contribution 🎉 👏. |
This functionality has been released in v4.56.0 of the Terraform AWS Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you! |
I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
Description
MessageAttributes subscription policy scope isn't compatible with nested subscription policies. Because of this, when updating from MessageAttributes to a MessageBody with nested subscription policies, since the order of update isn't guaranteed by the map implementation of the resource attributes, current implementation tries to set a nested subscription policy to a MessageAttributes scope before changing the scope to MessageBody. This results in an error.
This may result in an error the other way around: updating a nested subscription policy + MessageBody to a flat subscription policy + MessageAttributes . Since order isn't guaranteed, the scope may be updated to MessageAttributes before setting the flat subscription policy.
By chance this isn't currently happening, but it's still a risk if something changes in the underlying map implementation
References
Closes #28193.
Output from Acceptance Testing