|
86 | 86 | "Action": "s3:PutObject",
|
87 | 87 | "Condition": {
|
88 | 88 | "StringEquals": {
|
89 |
| - "aws:Referer": { |
| 89 | + "aws:SourceAccount": { |
90 | 90 | "Ref": "AWS::AccountId"
|
| 91 | + }, |
| 92 | + "aws:SourceArn": { |
| 93 | + "Fn::Join": [ |
| 94 | + "", |
| 95 | + [ |
| 96 | + "arn:", |
| 97 | + { |
| 98 | + "Ref": "AWS::Partition" |
| 99 | + }, |
| 100 | + ":ses:", |
| 101 | + { |
| 102 | + "Ref": "AWS::Region" |
| 103 | + }, |
| 104 | + ":", |
| 105 | + { |
| 106 | + "Ref": "AWS::AccountId" |
| 107 | + }, |
| 108 | + ":receipt-rule-set/INBOUND_MAIL:receipt-rule/", |
| 109 | + { |
| 110 | + "Ref": "RuleSetFirstRule0A27C8CC" |
| 111 | + } |
| 112 | + ] |
| 113 | + ] |
91 | 114 | }
|
92 | 115 | }
|
93 | 116 | },
|
|
172 | 195 | "UpdateReplacePolicy": "Retain",
|
173 | 196 | "DeletionPolicy": "Retain"
|
174 | 197 | },
|
175 |
| - "RuleSetE30C6C48": { |
176 |
| - "Type": "AWS::SES::ReceiptRuleSet" |
177 |
| - }, |
178 |
| - "RuleSetDropSpamRule5809F51B": { |
179 |
| - "Type": "AWS::SES::ReceiptRule", |
180 |
| - "Properties": { |
181 |
| - "Rule": { |
182 |
| - "Actions": [ |
183 |
| - { |
184 |
| - "LambdaAction": { |
185 |
| - "FunctionArn": { |
186 |
| - "Fn::GetAtt": [ |
187 |
| - "SingletonLambda224e77f9a32e4b4dac32983477abba164533EA15", |
188 |
| - "Arn" |
189 |
| - ] |
190 |
| - }, |
191 |
| - "InvocationType": "RequestResponse" |
192 |
| - } |
193 |
| - } |
194 |
| - ], |
195 |
| - "Enabled": true, |
196 |
| - "ScanEnabled": true |
197 |
| - }, |
198 |
| - "RuleSetName": { |
199 |
| - "Ref": "RuleSetE30C6C48" |
200 |
| - } |
201 |
| - } |
202 |
| - }, |
203 | 198 | "RuleSetFirstRule0A27C8CC": {
|
204 | 199 | "Type": "AWS::SES::ReceiptRule",
|
205 | 200 | "Properties": {
|
206 |
| - "After": { |
207 |
| - "Ref": "RuleSetDropSpamRule5809F51B" |
208 |
| - }, |
209 | 201 | "Rule": {
|
210 | 202 | "Actions": [
|
211 | 203 | {
|
|
256 | 248 | {
|
257 | 249 | "BounceAction": {
|
258 | 250 | "Message": "Message content rejected",
|
259 |
| - "Sender": "cdk-ses-receipt-test@yopmail.com", |
| 251 | + "Sender": "test@cdk-test-123.awsapps.com", |
260 | 252 | "SmtpReplyCode": "500",
|
261 | 253 | "StatusCode": "5.6.1",
|
262 | 254 | "TopicArn": {
|
|
268 | 260 | "Enabled": true,
|
269 | 261 | "Name": "FirstRule",
|
270 | 262 | "Recipients": [
|
271 |
| - "cdk-ses-receipt-test@yopmail.com" |
| 263 | + "test@cdk-test-123.awsapps.com" |
272 | 264 | ],
|
273 | 265 | "ScanEnabled": true,
|
274 | 266 | "TlsPolicy": "Require"
|
275 | 267 | },
|
276 |
| - "RuleSetName": { |
277 |
| - "Ref": "RuleSetE30C6C48" |
278 |
| - } |
| 268 | + "RuleSetName": "INBOUND_MAIL" |
279 | 269 | },
|
280 | 270 | "DependsOn": [
|
281 |
| - "BucketPolicyE9A3008A", |
282 | 271 | "FunctionAllowSes1829904A"
|
283 | 272 | ]
|
284 | 273 | },
|
|
301 | 290 | ],
|
302 | 291 | "Enabled": true
|
303 | 292 | },
|
304 |
| - "RuleSetName": { |
305 |
| - "Ref": "RuleSetE30C6C48" |
306 |
| - } |
| 293 | + "RuleSetName": "INBOUND_MAIL" |
307 | 294 | }
|
308 | 295 | },
|
309 |
| - "SingletonLambda224e77f9a32e4b4dac32983477abba16ServiceRole3037F5B4": { |
310 |
| - "Type": "AWS::IAM::Role", |
| 296 | + "NotificationQueue36610CC1": { |
| 297 | + "Type": "AWS::SQS::Queue", |
| 298 | + "UpdateReplacePolicy": "Delete", |
| 299 | + "DeletionPolicy": "Delete" |
| 300 | + }, |
| 301 | + "NotificationQueuePolicyCC060EA6": { |
| 302 | + "Type": "AWS::SQS::QueuePolicy", |
311 | 303 | "Properties": {
|
312 |
| - "AssumeRolePolicyDocument": { |
| 304 | + "PolicyDocument": { |
313 | 305 | "Statement": [
|
314 | 306 | {
|
315 |
| - "Action": "sts:AssumeRole", |
| 307 | + "Action": "sqs:SendMessage", |
| 308 | + "Condition": { |
| 309 | + "ArnEquals": { |
| 310 | + "aws:SourceArn": { |
| 311 | + "Ref": "TopicBFC7AF6E" |
| 312 | + } |
| 313 | + } |
| 314 | + }, |
316 | 315 | "Effect": "Allow",
|
317 | 316 | "Principal": {
|
318 |
| - "Service": "lambda.amazonaws.com" |
| 317 | + "Service": "sns.amazonaws.com" |
| 318 | + }, |
| 319 | + "Resource": { |
| 320 | + "Fn::GetAtt": [ |
| 321 | + "NotificationQueue36610CC1", |
| 322 | + "Arn" |
| 323 | + ] |
319 | 324 | }
|
320 | 325 | }
|
321 | 326 | ],
|
322 | 327 | "Version": "2012-10-17"
|
323 | 328 | },
|
324 |
| - "ManagedPolicyArns": [ |
| 329 | + "Queues": [ |
325 | 330 | {
|
326 |
| - "Fn::Join": [ |
327 |
| - "", |
328 |
| - [ |
329 |
| - "arn:", |
330 |
| - { |
331 |
| - "Ref": "AWS::Partition" |
332 |
| - }, |
333 |
| - ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" |
334 |
| - ] |
335 |
| - ] |
| 331 | + "Ref": "NotificationQueue36610CC1" |
336 | 332 | }
|
337 | 333 | ]
|
338 | 334 | }
|
339 | 335 | },
|
340 |
| - "SingletonLambda224e77f9a32e4b4dac32983477abba164533EA15": { |
341 |
| - "Type": "AWS::Lambda::Function", |
| 336 | + "NotificationQueueawscdksesreceiptTopicE9CA2388E8E96C33": { |
| 337 | + "Type": "AWS::SNS::Subscription", |
342 | 338 | "Properties": {
|
343 |
| - "Code": { |
344 |
| - "S3Bucket": { |
345 |
| - "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" |
346 |
| - }, |
347 |
| - "S3Key": "96d0b6be9a64ae309bf89a86f5515453f0fa1d07b4f6b37198051cc98e251f34.zip" |
348 |
| - }, |
349 |
| - "Handler": "index.handler", |
350 |
| - "Role": { |
| 339 | + "Endpoint": { |
351 | 340 | "Fn::GetAtt": [
|
352 |
| - "SingletonLambda224e77f9a32e4b4dac32983477abba16ServiceRole3037F5B4", |
| 341 | + "NotificationQueue36610CC1", |
353 | 342 | "Arn"
|
354 | 343 | ]
|
355 | 344 | },
|
356 |
| - "Runtime": "nodejs18.x" |
| 345 | + "Protocol": "sqs", |
| 346 | + "TopicArn": { |
| 347 | + "Ref": "TopicBFC7AF6E" |
| 348 | + } |
357 | 349 | },
|
358 | 350 | "DependsOn": [
|
359 |
| - "SingletonLambda224e77f9a32e4b4dac32983477abba16ServiceRole3037F5B4" |
| 351 | + "NotificationQueuePolicyCC060EA6" |
360 | 352 | ]
|
361 |
| - }, |
362 |
| - "SingletonLambda224e77f9a32e4b4dac32983477abba16AllowSesB42DF904": { |
363 |
| - "Type": "AWS::Lambda::Permission", |
364 |
| - "Properties": { |
365 |
| - "Action": "lambda:InvokeFunction", |
366 |
| - "FunctionName": { |
367 |
| - "Fn::GetAtt": [ |
368 |
| - "SingletonLambda224e77f9a32e4b4dac32983477abba164533EA15", |
369 |
| - "Arn" |
370 |
| - ] |
371 |
| - }, |
372 |
| - "Principal": "ses.amazonaws.com", |
373 |
| - "SourceAccount": { |
374 |
| - "Ref": "AWS::AccountId" |
375 |
| - } |
376 |
| - } |
377 | 353 | }
|
378 | 354 | },
|
379 | 355 | "Parameters": {
|
|
0 commit comments