Skip to content

Commit

Permalink
chore(ses): migrate drop spam handler (#27827)
Browse files Browse the repository at this point in the history
This PR moves the drop spam handler from aws-cdk-lib to our new centralized location for custom resource handlers in the https://github.com/aws-cdk package.

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
  • Loading branch information
colifran authored Nov 10, 2023
1 parent 73f256d commit 31a449e
Show file tree
Hide file tree
Showing 16 changed files with 181 additions and 64 deletions.

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

This file was deleted.

This file was deleted.

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

Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
"S3Bucket": {
"Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}"
},
"S3Key": "96d0b6be9a64ae309bf89a86f5515453f0fa1d07b4f6b37198051cc98e251f34.zip"
"S3Key": "19044c50ec489a0413f51a8e60d6272e5746e9b5a0356ed15c12de97c3ca93ec.zip"
},
"Handler": "index.handler",
"Role": {
Expand Down

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.

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.

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

Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import * as cdk from 'aws-cdk-lib';
import * as ses from 'aws-cdk-lib/aws-ses';
import { IntegTest } from '@aws-cdk/integ-tests-alpha';

const app = new cdk.App();

Expand All @@ -23,3 +24,8 @@ new ses.AllowListReceiptFilter(stack, 'Allowlist', {
'10.0.0.0/16',
],
});

new IntegTest(app, 'cdk-ses-receipt-integ', {
testCases: [stack],
diffAssets: true,
});
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { handler } from '../../lib/drop-spam-handler/index';
import { handler } from '../../lib/aws-ses/drop-spam-handler/index';

describe('handler', () => {
test.each(['spf', 'dkim', 'spam', 'virus'])('drop spam when %s status is FAIL', async (key) => {
Expand Down
Empty file.
22 changes: 0 additions & 22 deletions packages/aws-cdk-lib/aws-ses/lib/drop-spam-handler/index.ts

This file was deleted.

2 changes: 1 addition & 1 deletion packages/aws-cdk-lib/aws-ses/lib/receipt-rule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ export class DropSpamReceiptRule extends Construct {
const fn = new lambda.SingletonFunction(this, 'Function', {
runtime: lambda.Runtime.NODEJS_18_X,
handler: 'index.handler',
code: lambda.Code.fromAsset(path.join(__dirname, 'drop-spam-handler')),
code: lambda.Code.fromAsset(path.join(__dirname, '..', '..', 'custom-resource-handlers', 'dist', 'aws-ses', 'drop-spam-handler')),
uuid: '224e77f9-a32e-4b4d-ac32-983477abba16',
});

Expand Down

0 comments on commit 31a449e

Please sign in to comment.