@aws-solutions-constructs/aws-lambda-sns 2.50.0 → 2.52.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/.eslintignore +2 -0
  2. package/.jsii +50 -5
  3. package/integ.config.json +7 -0
  4. package/lib/index.js +1 -1
  5. package/package.json +12 -11
  6. package/test/integ.lamsns-deployFunction.js +5 -2
  7. package/test/integ.lamsns-deployFunction.js.snapshot/asset.0904d3723480fed2daf7885caa427b930881caae6879d1e6b0d395020173ef6f/index.js +21 -0
  8. package/test/integ.lamsns-deployFunction.js.snapshot/cdk.out +1 -0
  9. package/test/integ.lamsns-deployFunction.js.snapshot/integ.json +12 -0
  10. package/test/integ.lamsns-deployFunction.js.snapshot/lamsns-deployFunction.assets.json +32 -0
  11. package/test/integ.lamsns-deployFunction.js.snapshot/lamsns-deployFunction.template.json +302 -0
  12. package/test/integ.lamsns-deployFunction.js.snapshot/lamsnsdeployFunctionIntegDefaultTestDeployAssert36FE5D09.assets.json +19 -0
  13. package/test/integ.lamsns-deployFunction.js.snapshot/lamsnsdeployFunctionIntegDefaultTestDeployAssert36FE5D09.template.json +36 -0
  14. package/test/integ.lamsns-deployFunction.js.snapshot/manifest.json +137 -0
  15. package/test/integ.lamsns-deployFunction.js.snapshot/tree.json +474 -0
  16. package/test/integ.lamsns-deployFunctionWithVpc.js +6 -2
  17. package/test/integ.lamsns-deployFunctionWithVpc.js.snapshot/asset.0904d3723480fed2daf7885caa427b930881caae6879d1e6b0d395020173ef6f/index.js +21 -0
  18. package/test/integ.lamsns-deployFunctionWithVpc.js.snapshot/asset.dd5711540f04e06aa955d7f4862fc04e8cdea464cb590dae91ed2976bb78098e/__entrypoint__.js +1 -0
  19. package/test/integ.lamsns-deployFunctionWithVpc.js.snapshot/asset.dd5711540f04e06aa955d7f4862fc04e8cdea464cb590dae91ed2976bb78098e/index.js +1 -0
  20. package/test/integ.lamsns-deployFunctionWithVpc.js.snapshot/cdk.out +1 -0
  21. package/test/integ.lamsns-deployFunctionWithVpc.js.snapshot/integ.json +12 -0
  22. package/test/integ.lamsns-deployFunctionWithVpc.js.snapshot/lamsns-deployFunctionWithVpc.assets.json +45 -0
  23. package/test/integ.lamsns-deployFunctionWithVpc.js.snapshot/lamsns-deployFunctionWithVpc.template.json +829 -0
  24. package/test/integ.lamsns-deployFunctionWithVpc.js.snapshot/lamsnsdeployFunctionWithVpcIntegDefaultTestDeployAssertEDF33408.assets.json +19 -0
  25. package/test/integ.lamsns-deployFunctionWithVpc.js.snapshot/lamsnsdeployFunctionWithVpcIntegDefaultTestDeployAssertEDF33408.template.json +36 -0
  26. package/test/integ.lamsns-deployFunctionWithVpc.js.snapshot/manifest.json +239 -0
  27. package/test/integ.lamsns-deployFunctionWithVpc.js.snapshot/tree.json +1113 -0
  28. package/test/integ.lamsns-existingFunction.js +5 -2
  29. package/test/integ.lamsns-existingFunction.js.snapshot/asset.0904d3723480fed2daf7885caa427b930881caae6879d1e6b0d395020173ef6f/index.js +21 -0
  30. package/test/integ.lamsns-existingFunction.js.snapshot/cdk.out +1 -0
  31. package/test/integ.lamsns-existingFunction.js.snapshot/integ.json +12 -0
  32. package/test/integ.lamsns-existingFunction.js.snapshot/lamsns-existingFunction.assets.json +32 -0
  33. package/test/integ.lamsns-existingFunction.js.snapshot/lamsns-existingFunction.template.json +302 -0
  34. package/test/integ.lamsns-existingFunction.js.snapshot/lamsnsexistingFunctionIntegDefaultTestDeployAssert733AE3CB.assets.json +19 -0
  35. package/test/integ.lamsns-existingFunction.js.snapshot/lamsnsexistingFunctionIntegDefaultTestDeployAssert733AE3CB.template.json +36 -0
  36. package/test/integ.lamsns-existingFunction.js.snapshot/manifest.json +137 -0
  37. package/test/integ.lamsns-existingFunction.js.snapshot/tree.json +474 -0
  38. package/test/integ.lamsns-deployFunction.expected.json +0 -302
  39. package/test/integ.lamsns-deployFunctionWithVpc.expected.json +0 -744
  40. package/test/integ.lamsns-existingFunction.expected.json +0 -302
@@ -1,302 +0,0 @@
1
- {
2
- "Description": "Integration Test for aws-lambda-sns",
3
- "Resources": {
4
- "LambdaFunctionServiceRole0C4CDE0B": {
5
- "Type": "AWS::IAM::Role",
6
- "Properties": {
7
- "AssumeRolePolicyDocument": {
8
- "Statement": [
9
- {
10
- "Action": "sts:AssumeRole",
11
- "Effect": "Allow",
12
- "Principal": {
13
- "Service": "lambda.amazonaws.com"
14
- }
15
- }
16
- ],
17
- "Version": "2012-10-17"
18
- },
19
- "Policies": [
20
- {
21
- "PolicyDocument": {
22
- "Statement": [
23
- {
24
- "Action": [
25
- "logs:CreateLogGroup",
26
- "logs:CreateLogStream",
27
- "logs:PutLogEvents"
28
- ],
29
- "Effect": "Allow",
30
- "Resource": {
31
- "Fn::Join": [
32
- "",
33
- [
34
- "arn:",
35
- {
36
- "Ref": "AWS::Partition"
37
- },
38
- ":logs:",
39
- {
40
- "Ref": "AWS::Region"
41
- },
42
- ":",
43
- {
44
- "Ref": "AWS::AccountId"
45
- },
46
- ":log-group:/aws/lambda/*"
47
- ]
48
- ]
49
- }
50
- }
51
- ],
52
- "Version": "2012-10-17"
53
- },
54
- "PolicyName": "LambdaFunctionServiceRolePolicy"
55
- }
56
- ]
57
- }
58
- },
59
- "LambdaFunctionServiceRoleDefaultPolicy126C8897": {
60
- "Type": "AWS::IAM::Policy",
61
- "Properties": {
62
- "PolicyDocument": {
63
- "Statement": [
64
- {
65
- "Action": [
66
- "xray:PutTraceSegments",
67
- "xray:PutTelemetryRecords"
68
- ],
69
- "Effect": "Allow",
70
- "Resource": "*"
71
- },
72
- {
73
- "Action": "sns:Publish",
74
- "Effect": "Allow",
75
- "Resource": {
76
- "Ref": "testlambdasnsSnsTopic57DFED98"
77
- }
78
- }
79
- ],
80
- "Version": "2012-10-17"
81
- },
82
- "PolicyName": "LambdaFunctionServiceRoleDefaultPolicy126C8897",
83
- "Roles": [
84
- {
85
- "Ref": "LambdaFunctionServiceRole0C4CDE0B"
86
- }
87
- ]
88
- },
89
- "Metadata": {
90
- "cfn_nag": {
91
- "rules_to_suppress": [
92
- {
93
- "id": "W12",
94
- "reason": "Lambda needs the following minimum required permissions to send trace data to X-Ray and access ENIs in a VPC."
95
- }
96
- ]
97
- }
98
- }
99
- },
100
- "LambdaFunctionBF21E41F": {
101
- "Type": "AWS::Lambda::Function",
102
- "Properties": {
103
- "Code": {
104
- "S3Bucket": {
105
- "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}"
106
- },
107
- "S3Key": "0904d3723480fed2daf7885caa427b930881caae6879d1e6b0d395020173ef6f.zip"
108
- },
109
- "Environment": {
110
- "Variables": {
111
- "AWS_NODEJS_CONNECTION_REUSE_ENABLED": "1",
112
- "SNS_TOPIC_ARN": {
113
- "Ref": "testlambdasnsSnsTopic57DFED98"
114
- },
115
- "SNS_TOPIC_NAME": {
116
- "Fn::GetAtt": [
117
- "testlambdasnsSnsTopic57DFED98",
118
- "TopicName"
119
- ]
120
- }
121
- }
122
- },
123
- "Handler": "index.handler",
124
- "Role": {
125
- "Fn::GetAtt": [
126
- "LambdaFunctionServiceRole0C4CDE0B",
127
- "Arn"
128
- ]
129
- },
130
- "Runtime": "nodejs16.x",
131
- "TracingConfig": {
132
- "Mode": "Active"
133
- }
134
- },
135
- "DependsOn": [
136
- "LambdaFunctionServiceRoleDefaultPolicy126C8897",
137
- "LambdaFunctionServiceRole0C4CDE0B"
138
- ],
139
- "Metadata": {
140
- "cfn_nag": {
141
- "rules_to_suppress": [
142
- {
143
- "id": "W58",
144
- "reason": "Lambda functions has the required permission to write CloudWatch Logs. It uses custom policy instead of arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole with tighter permissions."
145
- },
146
- {
147
- "id": "W89",
148
- "reason": "This is not a rule for the general case, just for specific use cases/industries"
149
- },
150
- {
151
- "id": "W92",
152
- "reason": "Impossible for us to define the correct concurrency for clients"
153
- }
154
- ]
155
- }
156
- }
157
- },
158
- "testlambdasnsSnsTopic57DFED98": {
159
- "Type": "AWS::SNS::Topic",
160
- "Properties": {
161
- "KmsMasterKeyId": {
162
- "Fn::Join": [
163
- "",
164
- [
165
- "arn:",
166
- {
167
- "Ref": "AWS::Partition"
168
- },
169
- ":kms:",
170
- {
171
- "Ref": "AWS::Region"
172
- },
173
- ":",
174
- {
175
- "Ref": "AWS::AccountId"
176
- },
177
- ":alias/aws/sns"
178
- ]
179
- ]
180
- }
181
- }
182
- },
183
- "testlambdasnsSnsTopicPolicy4481ABC3": {
184
- "Type": "AWS::SNS::TopicPolicy",
185
- "Properties": {
186
- "PolicyDocument": {
187
- "Statement": [
188
- {
189
- "Action": [
190
- "SNS:Publish",
191
- "SNS:RemovePermission",
192
- "SNS:SetTopicAttributes",
193
- "SNS:DeleteTopic",
194
- "SNS:ListSubscriptionsByTopic",
195
- "SNS:GetTopicAttributes",
196
- "SNS:Receive",
197
- "SNS:AddPermission",
198
- "SNS:Subscribe"
199
- ],
200
- "Condition": {
201
- "StringEquals": {
202
- "AWS:SourceOwner": {
203
- "Ref": "AWS::AccountId"
204
- }
205
- }
206
- },
207
- "Effect": "Allow",
208
- "Principal": {
209
- "AWS": {
210
- "Fn::Join": [
211
- "",
212
- [
213
- "arn:",
214
- {
215
- "Ref": "AWS::Partition"
216
- },
217
- ":iam::",
218
- {
219
- "Ref": "AWS::AccountId"
220
- },
221
- ":root"
222
- ]
223
- ]
224
- }
225
- },
226
- "Resource": {
227
- "Ref": "testlambdasnsSnsTopic57DFED98"
228
- },
229
- "Sid": "TopicOwnerOnlyAccess"
230
- },
231
- {
232
- "Action": [
233
- "SNS:Publish",
234
- "SNS:RemovePermission",
235
- "SNS:SetTopicAttributes",
236
- "SNS:DeleteTopic",
237
- "SNS:ListSubscriptionsByTopic",
238
- "SNS:GetTopicAttributes",
239
- "SNS:Receive",
240
- "SNS:AddPermission",
241
- "SNS:Subscribe"
242
- ],
243
- "Condition": {
244
- "Bool": {
245
- "aws:SecureTransport": "false"
246
- }
247
- },
248
- "Effect": "Deny",
249
- "Principal": {
250
- "AWS": "*"
251
- },
252
- "Resource": {
253
- "Ref": "testlambdasnsSnsTopic57DFED98"
254
- },
255
- "Sid": "HttpsOnly"
256
- }
257
- ],
258
- "Version": "2012-10-17"
259
- },
260
- "Topics": [
261
- {
262
- "Ref": "testlambdasnsSnsTopic57DFED98"
263
- }
264
- ]
265
- }
266
- }
267
- },
268
- "Parameters": {
269
- "BootstrapVersion": {
270
- "Type": "AWS::SSM::Parameter::Value<String>",
271
- "Default": "/cdk-bootstrap/hnb659fds/version",
272
- "Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]"
273
- }
274
- },
275
- "Rules": {
276
- "CheckBootstrapVersion": {
277
- "Assertions": [
278
- {
279
- "Assert": {
280
- "Fn::Not": [
281
- {
282
- "Fn::Contains": [
283
- [
284
- "1",
285
- "2",
286
- "3",
287
- "4",
288
- "5"
289
- ],
290
- {
291
- "Ref": "BootstrapVersion"
292
- }
293
- ]
294
- }
295
- ]
296
- },
297
- "AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI."
298
- }
299
- ]
300
- }
301
- }
302
- }