Skip to content

Commit 27babe6

Browse files
feat(sns): add delivery policy to sns subscriptions (#30830)
### Issue # (if applicable) Closes #17576. ### Reason for this change To allow setting of delivery policy for appropriate sns subscriptions. ### Description of changes Subscriptions can now take a new parameter `deliveryPolicy` which consists of a `healthyRetryPolicy`, a `throttlePolicy`, and a `requestPolicy` (each having the same parameters described here: https://docs.aws.amazon.com/sns/latest/dg/sns-message-delivery-retries.html#creating-delivery-policy). ### Description of how you validated changes New integration test along with unit tests. ### Checklist - [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent be33610 commit 27babe6

File tree

15 files changed

+1031
-0
lines changed

15 files changed

+1031
-0
lines changed

packages/@aws-cdk-testing/framework-integ/test/aws-sns-subscriptions/test/integ.sns-url.js.snapshot/SnsToUrlStack.assets.json

Lines changed: 19 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
{
2+
"Resources": {
3+
"MyTopic86869434": {
4+
"Type": "AWS::SNS::Topic"
5+
},
6+
"MyTopichttpsfoobarcomDEA92AB5": {
7+
"Type": "AWS::SNS::Subscription",
8+
"Properties": {
9+
"DeliveryPolicy": {
10+
"healthyRetryPolicy": {
11+
"minDelayTarget": 20,
12+
"maxDelayTarget": 21,
13+
"numRetries": 10
14+
},
15+
"throttlePolicy": {
16+
"maxReceivesPerSecond": 10
17+
},
18+
"requestPolicy": {
19+
"headerContentType": "application/json"
20+
}
21+
},
22+
"Endpoint": "https://foobar.com/",
23+
"Protocol": "https",
24+
"TopicArn": {
25+
"Ref": "MyTopic86869434"
26+
}
27+
}
28+
}
29+
},
30+
"Parameters": {
31+
"BootstrapVersion": {
32+
"Type": "AWS::SSM::Parameter::Value<String>",
33+
"Default": "/cdk-bootstrap/hnb659fds/version",
34+
"Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]"
35+
}
36+
},
37+
"Rules": {
38+
"CheckBootstrapVersion": {
39+
"Assertions": [
40+
{
41+
"Assert": {
42+
"Fn::Not": [
43+
{
44+
"Fn::Contains": [
45+
[
46+
"1",
47+
"2",
48+
"3",
49+
"4",
50+
"5"
51+
],
52+
{
53+
"Ref": "BootstrapVersion"
54+
}
55+
]
56+
}
57+
]
58+
},
59+
"AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI."
60+
}
61+
]
62+
}
63+
}
64+
}

packages/@aws-cdk-testing/framework-integ/test/aws-sns-subscriptions/test/integ.sns-url.js.snapshot/cdk.out

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-sns-subscriptions/test/integ.sns-url.js.snapshot/cdkintegDefaultTestDeployAssert83AD650C.assets.json

Lines changed: 19 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-sns-subscriptions/test/integ.sns-url.js.snapshot/cdkintegDefaultTestDeployAssert83AD650C.template.json

Lines changed: 36 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-sns-subscriptions/test/integ.sns-url.js.snapshot/integ.json

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-sns-subscriptions/test/integ.sns-url.js.snapshot/manifest.json

Lines changed: 119 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)