Skip to content

Commit

Permalink
feat(ses-actions): WorkMail rule action (#29854)
Browse files Browse the repository at this point in the history
### 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*
  • Loading branch information
nmussy committed Apr 24, 2024
1 parent 466f170 commit 6fdc458
Show file tree
Hide file tree
Showing 10 changed files with 494 additions and 64 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Expand Up @@ -105,7 +105,11 @@
{
"Ref": "AWS::AccountId"
},
":receipt-rule-set/INBOUND_MAIL:receipt-rule/",
":receipt-rule-set/",
{
"Ref": "RuleSetE30C6C48"
},
":receipt-rule/",
{
"Ref": "RuleSetFirstRule0A27C8CC"
}
Expand Down Expand Up @@ -195,11 +199,50 @@
"UpdateReplacePolicy": "Retain",
"DeletionPolicy": "Retain"
},
"RuleSetE30C6C48": {
"Type": "AWS::SES::ReceiptRuleSet"
},
"RuleSetDropSpamRule5809F51B": {
"Type": "AWS::SES::ReceiptRule",
"Properties": {
"Rule": {
"Actions": [
{
"LambdaAction": {
"FunctionArn": {
"Fn::GetAtt": [
"SingletonLambda224e77f9a32e4b4dac32983477abba164533EA15",
"Arn"
]
},
"InvocationType": "RequestResponse"
}
}
],
"Enabled": true,
"ScanEnabled": true
},
"RuleSetName": {
"Ref": "RuleSetE30C6C48"
}
}
},
"RuleSetFirstRule0A27C8CC": {
"Type": "AWS::SES::ReceiptRule",
"Properties": {
"After": {
"Ref": "RuleSetDropSpamRule5809F51B"
},
"Rule": {
"Actions": [
{
"WorkmailAction": {
"OrganizationArn": "arn:aws:workmail:us-east-1:339712719728:organization/m-5ea60ed9e37442c388898996f05c17ac",
"TopicArn": {
"Ref": "TopicBFC7AF6E"
}
}
},
{
"AddHeaderAction": {
"HeaderName": "X-My-Header",
Expand Down Expand Up @@ -265,7 +308,9 @@
"ScanEnabled": true,
"TlsPolicy": "Require"
},
"RuleSetName": "INBOUND_MAIL"
"RuleSetName": {
"Ref": "RuleSetE30C6C48"
}
},
"DependsOn": [
"FunctionAllowSes1829904A"
Expand All @@ -290,7 +335,78 @@
],
"Enabled": true
},
"RuleSetName": "INBOUND_MAIL"
"RuleSetName": {
"Ref": "RuleSetE30C6C48"
}
}
},
"SingletonLambda224e77f9a32e4b4dac32983477abba16ServiceRole3037F5B4": {
"Type": "AWS::IAM::Role",
"Properties": {
"AssumeRolePolicyDocument": {
"Statement": [
{
"Action": "sts:AssumeRole",
"Effect": "Allow",
"Principal": {
"Service": "lambda.amazonaws.com"
}
}
],
"Version": "2012-10-17"
},
"ManagedPolicyArns": [
{
"Fn::Join": [
"",
[
"arn:",
{
"Ref": "AWS::Partition"
},
":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole"
]
]
}
]
}
},
"SingletonLambda224e77f9a32e4b4dac32983477abba164533EA15": {
"Type": "AWS::Lambda::Function",
"Properties": {
"Code": {
"S3Bucket": {
"Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}"
},
"S3Key": "19044c50ec489a0413f51a8e60d6272e5746e9b5a0356ed15c12de97c3ca93ec.zip"
},
"Handler": "index.handler",
"Role": {
"Fn::GetAtt": [
"SingletonLambda224e77f9a32e4b4dac32983477abba16ServiceRole3037F5B4",
"Arn"
]
},
"Runtime": "nodejs18.x"
},
"DependsOn": [
"SingletonLambda224e77f9a32e4b4dac32983477abba16ServiceRole3037F5B4"
]
},
"SingletonLambda224e77f9a32e4b4dac32983477abba16AllowSesB42DF904": {
"Type": "AWS::Lambda::Permission",
"Properties": {
"Action": "lambda:InvokeFunction",
"FunctionName": {
"Fn::GetAtt": [
"SingletonLambda224e77f9a32e4b4dac32983477abba164533EA15",
"Arn"
]
},
"Principal": "ses.amazonaws.com",
"SourceAccount": {
"Ref": "AWS::AccountId"
}
}
},
"NotificationQueue36610CC1": {
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 6fdc458

Please sign in to comment.