-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
feat(sns): Add FilterPolicyScope support #23108
Conversation
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.
The pull request linter has failed. See the aws-cdk-automation comment below for failure reasons. If you believe this pull request should receive an exemption, please comment and provide a justification.
✅ Updated pull request passes all PRLinter validations. Dissmissing previous PRLinter review.
Thanks for the PR for this feature @brennanho, This feature works and I'm able to deploy stacks with it, however we cannot manually add properties to the CfnSpec. We will need to wait until this property is defined in the specification, and then merged. This PR should be a great place to return to once we get L1 support, I'm going to convert this PR to a draft in the meantime |
I think this PR is not sufficient to cover this: https://docs.aws.amazon.com/sns/latest/dg/subscription-filter-policy-constraints.html#subscription-filter-policy-payload-constraints
This will still not be supported after merging this PR because the filter policy will not be parsable. |
Ah thats interesting. I think some changes need to be made with how the Edit: |
@brennanho I certainly would prefer the latter version |
packages/@aws-cdk/cfnspec/spec-source/specification/000_cfn/000_official/000_AWS_SNS.json
Outdated
Show resolved
Hide resolved
0203bce
to
d780005
Compare
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.
The pull request linter has failed. See the aws-cdk-automation comment below for failure reasons. If you believe this pull request should receive an exemption, please comment and provide a justification.
d780005
to
1591590
Compare
✅ Updated pull request passes all PRLinter validations. Dissmissing previous PRLinter review.
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.
The pull request linter has failed. See the aws-cdk-automation comment below for failure reasons. If you believe this pull request should receive an exemption, please comment and provide a justification.
d780005
to
6b8c9f4
Compare
Hey @brennanho, thanks for the update. I was working off the code you pushed as well and came up with this. I was misunderstanding the type of the top level input for the I also changed the body of I also started going down the path of making You don't have to take all these changes, but it does feel more simplified to me (closer to what you had originally before I made you complicate it 😄 ), but take what you think feels useful. On the integ test, it's a little confusing but within the mono-repo, before the package is published, it just exists under the |
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.
Thanks @brennanho!
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
Pull request has been modified.
@MrArnoldPalmer No problem and thanks for your help! Sorry I had to merge from main, do you think you could approve again please? 😄 |
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
@MrArnoldPalmer Looks like the automatic merge failed. I have the permissions enabled to update from main and all the previous checks passed. I have installed Mergify on my aws account and given it permissions for read/write. Looks like I still need to enable workflow permissions and some solutions online state I need to repush with a new PAT that includes workflow permissions. If that is the case I would need another approval (no code change). Unfortunately I am not seeing anything addressing this in the contribution guideline. Please advise thanks! |
@Mergifyio refresh |
✅ Pull request refreshed |
Pull request has been modified.
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
@brennanho could you please release this change? 🙏🏻 |
I think there are automatic chore releases done weekly. Like the following for example from last week 539d036. Correct me if I am wrong. |
Yeah we release weekly usually, this will go out as part of the next release. |
---- closes aws#23079 ### Description This PR adds support for FilterPolicyScope for SNS subscriptions. This is in response to AWS introducing payload-based message filtering: https://aws.amazon.com/blogs/compute/introducing-payload-based-message-filtering-for-amazon-sns/. ### All Submissions: * [x] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) ### Adding new Unconventional Dependencies: * [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md/#adding-new-unconventional-dependencies) ### New Features * [x] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/main/INTEGRATION_TESTS.md)? * [x] Did you use `yarn integ` to deploy the infrastructure and generate the snapshot (i.e. `yarn integ` without `--dry-run`)? *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
After this feature was released, we're unable to deploy stacks that use filterPolicy (not filterPolicyWithMessageBody). I believe it's due to the following change where the FilterPolicyScope is undefined unless filterPolicyWithMessageBody is used. The error we are getting:
If I revert to the previous release (2.65.0), the stack successfully deploys. |
@Ksenia11 can you please create a new issue with a quick reproduction of how you've defined this construct? |
@peterwoodworth done - issue. |
---- closes aws#23079 ### Description This PR adds support for FilterPolicyScope for SNS subscriptions. This is in response to AWS introducing payload-based message filtering: https://aws.amazon.com/blogs/compute/introducing-payload-based-message-filtering-for-amazon-sns/. ### All Submissions: * [x] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) ### Adding new Unconventional Dependencies: * [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md/#adding-new-unconventional-dependencies) ### New Features * [x] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/main/INTEGRATION_TESTS.md)? * [x] Did you use `yarn integ` to deploy the infrastructure and generate the snapshot (i.e. `yarn integ` without `--dry-run`)? *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
@brennanho Hi, I'm having a problem with this feature. As you see on my screenshot, I'm creating a filter policy for a Any idea on why this could be happening? |
I believe you may need to use a CfnSubscription instead and use
CfnSubscriptionProps with `filterPolicyScope: 'MessageBody',` .. this is
what we are doing anyway.
@robpark
…On Thu, Jul 27, 2023 at 3:37 PM pabloizquierdoalegra < ***@***.***> wrote:
Hi, I'm having a problem with this feature.
[image: image]
<https://user-images.githubusercontent.com/110133105/256645544-b1121a50-3fea-416c-ab8c-7154d1ae64f2.png>
As you see on my screenshot, I'm creating a filter policy for a keyCountry
attribute in the message body. But the result after deploying to aws is
that the filter policy is set to Message Attributes instead of Message Body.
[image: image]
<https://user-images.githubusercontent.com/110133105/256646359-1af52fdf-30c7-4260-ad48-6b9a936b6738.png>
Any idea on why this could be happening?
—
Reply to this email directly, view it on GitHub
<#23108 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAZZBBW4TIXD52R5W75SLDXSK7NZANCNFSM6AAAAAASMWNT2M>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
closes #23079
Description
This PR adds support for FilterPolicyScope for SNS subscriptions. This is in response to AWS introducing payload-based message filtering: https://aws.amazon.com/blogs/compute/introducing-payload-based-message-filtering-for-amazon-sns/.
All Submissions:
Adding new Unconventional Dependencies:
New Features
yarn integ
to deploy the infrastructure and generate the snapshot (i.e.yarn integ
without--dry-run
)?By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license