-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Sns: v2 data protection operations #13525
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
Conversation
ad28068 to
82ab790
Compare
Test Results - Preflight, Unit22 981 tests +3 21 139 ✅ +3 6m 50s ⏱️ +18s Results for commit 734c2de. ± Comparison against base commit 4532ad6. This pull request removes 1 and adds 4 tests. Note that renamed tests count towards both.♻️ This comment has been updated with latest results. |
Test Results - Alternative Providers208 tests 164 ✅ 2m 5s ⏱️ Results for commit 734c2de. ♻️ This comment has been updated with latest results. |
Test Results (amd64) - Integration, Bootstrap 5 files 5 suites 1h 28m 47s ⏱️ Results for commit 734c2de. ♻️ This comment has been updated with latest results. |
LocalStack Community integration with Pro 2 files ± 0 2 suites ±0 59m 54s ⏱️ - 57m 13s Results for commit 734c2de. ± Comparison against base commit 4532ad6. This pull request removes 2030 and adds 6 tests. Note that renamed tests count towards both.This pull request removes 224 skipped tests and adds 1 skipped test. Note that renamed tests count towards both.♻️ This comment has been updated with latest results. |
bentsku
left a comment
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.
Nice work! Nice that we have support for more operations now! I've checked the logic and I think the EffectiveDeliveryPolicy new logic is not correct, this is added at topic creation I believe. I've added more context in the comment 👍
tests/aws/services/sns/test_sns.py
Outdated
| # check if policy shows up in the attributes | ||
| response = aws_client.sns.get_topic_attributes(TopicArn=topic_arn) | ||
| snapshot.match("get-topic-attributes", response) |
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.
nit: could we maybe call get_topic_attributes before calling put_data_protection_policy to see the before/after? I'm curious about the EffectiveDeliveryPolicy being created 😄
I've given it a try locally and I can confirm that the EffectiveDeliveryPolicy is already present before the call, so I think the logic needs to be updated. This can be done either in this PR (add the policy at topic creation) or in another PR (add a snapshot skip for the delivery policy for now in this PR and add the policy in a follow-up PR)
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.
You are right. I moved this to the topic creation, and as a result, also removed the EffectiveDeliveryPolicy from most of the snapshot skips :)
bentsku
left a comment
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! Thanks for addressing the comment! I've added another comment regarding the EffectiveDeliveryPolicy, to make sure we're updating it when updating the DeliveryPolicy but this should be tackled as a follow-up 👍 nice work!
| return default_attributes | ||
|
|
||
|
|
||
| def _create_default_effective_delivery_policy(): |
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.
I believe this is somewhat of the default: I think the behavior is somewhat different: the EffectiveDeliveryPolicy is a merged value between the default value and what would be set for DeliveryPolicy. Meaning if you set for example the defaultRequestPolicy in your DeliveryPolicy, you effective delivery policy will be a merged between the default value, and that value you set, effectively being the "Effective" value.
I believe we will need to implement this behavior, it would be a great addition.
Doesn't need to be implemented in this PR as we had an issue before already, but it would be nice to keep track of this 👍 (basically updating the effective policy when updating the delivery policy)
Motivation
Adds methods for creating and retrieving data protection policies. These policies are not enforced with this PR, since the methods are not present in moto right now to begin with.
closes PNX-74
closes PNX-378
Changes
Tests
Related