Skip to content

Commit 6fdc458

Browse files
authored
feat(ses-actions): WorkMail rule action (#29854)
### Issue # (if applicable) None that I could find ### Reason for this change Adds missing `WorkMail` SES rule action ### Description of changes * Implement `WorkMail` action ### Description of how you validated changes Added unit test, integ test ### 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 466f170 commit 6fdc458

File tree

10 files changed

+494
-64
lines changed

10 files changed

+494
-64
lines changed

packages/@aws-cdk-testing/framework-integ/test/aws-ses-actions/test/integ.actions.js.snapshot/asset.19044c50ec489a0413f51a8e60d6272e5746e9b5a0356ed15c12de97c3ca93ec/index.js

+1
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-ses-actions/test/integ.actions.js.snapshot/aws-cdk-ses-receipt.assets.json

+15-2
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-ses-actions/test/integ.actions.js.snapshot/aws-cdk-ses-receipt.template.json

+119-3
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,11 @@
105105
{
106106
"Ref": "AWS::AccountId"
107107
},
108-
":receipt-rule-set/INBOUND_MAIL:receipt-rule/",
108+
":receipt-rule-set/",
109+
{
110+
"Ref": "RuleSetE30C6C48"
111+
},
112+
":receipt-rule/",
109113
{
110114
"Ref": "RuleSetFirstRule0A27C8CC"
111115
}
@@ -195,11 +199,50 @@
195199
"UpdateReplacePolicy": "Retain",
196200
"DeletionPolicy": "Retain"
197201
},
202+
"RuleSetE30C6C48": {
203+
"Type": "AWS::SES::ReceiptRuleSet"
204+
},
205+
"RuleSetDropSpamRule5809F51B": {
206+
"Type": "AWS::SES::ReceiptRule",
207+
"Properties": {
208+
"Rule": {
209+
"Actions": [
210+
{
211+
"LambdaAction": {
212+
"FunctionArn": {
213+
"Fn::GetAtt": [
214+
"SingletonLambda224e77f9a32e4b4dac32983477abba164533EA15",
215+
"Arn"
216+
]
217+
},
218+
"InvocationType": "RequestResponse"
219+
}
220+
}
221+
],
222+
"Enabled": true,
223+
"ScanEnabled": true
224+
},
225+
"RuleSetName": {
226+
"Ref": "RuleSetE30C6C48"
227+
}
228+
}
229+
},
198230
"RuleSetFirstRule0A27C8CC": {
199231
"Type": "AWS::SES::ReceiptRule",
200232
"Properties": {
233+
"After": {
234+
"Ref": "RuleSetDropSpamRule5809F51B"
235+
},
201236
"Rule": {
202237
"Actions": [
238+
{
239+
"WorkmailAction": {
240+
"OrganizationArn": "arn:aws:workmail:us-east-1:339712719728:organization/m-5ea60ed9e37442c388898996f05c17ac",
241+
"TopicArn": {
242+
"Ref": "TopicBFC7AF6E"
243+
}
244+
}
245+
},
203246
{
204247
"AddHeaderAction": {
205248
"HeaderName": "X-My-Header",
@@ -265,7 +308,9 @@
265308
"ScanEnabled": true,
266309
"TlsPolicy": "Require"
267310
},
268-
"RuleSetName": "INBOUND_MAIL"
311+
"RuleSetName": {
312+
"Ref": "RuleSetE30C6C48"
313+
}
269314
},
270315
"DependsOn": [
271316
"FunctionAllowSes1829904A"
@@ -290,7 +335,78 @@
290335
],
291336
"Enabled": true
292337
},
293-
"RuleSetName": "INBOUND_MAIL"
338+
"RuleSetName": {
339+
"Ref": "RuleSetE30C6C48"
340+
}
341+
}
342+
},
343+
"SingletonLambda224e77f9a32e4b4dac32983477abba16ServiceRole3037F5B4": {
344+
"Type": "AWS::IAM::Role",
345+
"Properties": {
346+
"AssumeRolePolicyDocument": {
347+
"Statement": [
348+
{
349+
"Action": "sts:AssumeRole",
350+
"Effect": "Allow",
351+
"Principal": {
352+
"Service": "lambda.amazonaws.com"
353+
}
354+
}
355+
],
356+
"Version": "2012-10-17"
357+
},
358+
"ManagedPolicyArns": [
359+
{
360+
"Fn::Join": [
361+
"",
362+
[
363+
"arn:",
364+
{
365+
"Ref": "AWS::Partition"
366+
},
367+
":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole"
368+
]
369+
]
370+
}
371+
]
372+
}
373+
},
374+
"SingletonLambda224e77f9a32e4b4dac32983477abba164533EA15": {
375+
"Type": "AWS::Lambda::Function",
376+
"Properties": {
377+
"Code": {
378+
"S3Bucket": {
379+
"Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}"
380+
},
381+
"S3Key": "19044c50ec489a0413f51a8e60d6272e5746e9b5a0356ed15c12de97c3ca93ec.zip"
382+
},
383+
"Handler": "index.handler",
384+
"Role": {
385+
"Fn::GetAtt": [
386+
"SingletonLambda224e77f9a32e4b4dac32983477abba16ServiceRole3037F5B4",
387+
"Arn"
388+
]
389+
},
390+
"Runtime": "nodejs18.x"
391+
},
392+
"DependsOn": [
393+
"SingletonLambda224e77f9a32e4b4dac32983477abba16ServiceRole3037F5B4"
394+
]
395+
},
396+
"SingletonLambda224e77f9a32e4b4dac32983477abba16AllowSesB42DF904": {
397+
"Type": "AWS::Lambda::Permission",
398+
"Properties": {
399+
"Action": "lambda:InvokeFunction",
400+
"FunctionName": {
401+
"Fn::GetAtt": [
402+
"SingletonLambda224e77f9a32e4b4dac32983477abba164533EA15",
403+
"Arn"
404+
]
405+
},
406+
"Principal": "ses.amazonaws.com",
407+
"SourceAccount": {
408+
"Ref": "AWS::AccountId"
409+
}
294410
}
295411
},
296412
"NotificationQueue36610CC1": {

packages/@aws-cdk-testing/framework-integ/test/aws-ses-actions/test/integ.actions.js.snapshot/manifest.json

+29-44
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)