Skip to content

Commit 41aa72c

Browse files
authored
feat(ses): Virtual Deliverability Manager (#22908)
Add a L2 for Virtual Deliverability Manager. ---- ### All Submissions: * [x] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) ### Adding new Unconventional Dependencies: * [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md/#adding-new-unconventional-dependencies) ### New Features * [x] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/main/INTEGRATION_TESTS.md)? * [x] Did you use `yarn integ` to deploy the infrastructure and generate the snapshot (i.e. `yarn integ` without `--dry-run`)? *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent 5ecee55 commit 41aa72c

14 files changed

+515
-1
lines changed

packages/@aws-cdk/aws-ses/README.md

+14
Original file line numberDiff line numberDiff line change
@@ -202,3 +202,17 @@ for (const record of identity.dkimRecords) {
202202
// create CNAME records using `record.name` and `record.value`
203203
}
204204
```
205+
206+
### Virtual Deliverability Manager (VDM)
207+
208+
Virtual Deliverability Manager is an Amazon SES feature that helps you enhance email deliverability,
209+
like increasing inbox deliverability and email conversions, by providing insights into your sending
210+
and delivery data, and giving advice on how to fix the issues that are negatively affecting your
211+
delivery success rate and reputation.
212+
213+
Use the `VdmAttributes` construct to configure the Virtual Deliverability Manager for your account:
214+
215+
```ts
216+
// Enables engagement tracking and optimized shared delivery by default
217+
new ses.VdmAttributes(this, 'Vdm');
218+
```

packages/@aws-cdk/aws-ses/lib/index.ts

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ export * from './receipt-filter';
55
export * from './dedicated-ip-pool';
66
export * from './configuration-set';
77
export * from './email-identity';
8+
export * from './vdm-attributes';
89

910
// AWS::SES CloudFormation Resources:
1011
export * from './ses.generated';
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
import { IResource, Resource } from '@aws-cdk/core';
2+
import { Construct } from 'constructs';
3+
import { CfnVdmAttributes } from './ses.generated';
4+
5+
/**
6+
* Virtual Deliverablity Manager (VDM) attributes
7+
*/
8+
export interface IVdmAttributes extends IResource {
9+
/**
10+
* The name of the resource behind the Virtual Deliverablity Manager attributes.
11+
*
12+
* @attribute
13+
*/
14+
readonly vdmAttributesName: string;
15+
}
16+
17+
/**
18+
* Properties for the Virtual Deliverablity Manager (VDM) attributes
19+
*/
20+
export interface VdmAttributesProps {
21+
/**
22+
* Whether engagement metrics are enabled for your account
23+
*
24+
* @default true
25+
*/
26+
readonly engagementMetrics?: boolean
27+
28+
/**
29+
* Whether optimized shared delivery is enabled for your account
30+
*
31+
* @default true
32+
*/
33+
readonly optimizedSharedDelivery?: boolean
34+
}
35+
36+
/**
37+
* Virtual Deliverablity Manager (VDM) attributes
38+
*/
39+
export class VdmAttributes extends Resource implements IVdmAttributes {
40+
/**
41+
* Use an existing Virtual Deliverablity Manager attributes resource
42+
*/
43+
public static fromVdmAttributesName(scope: Construct, id: string, vdmAttributesName: string): IVdmAttributes {
44+
class Import extends Resource implements IVdmAttributes {
45+
public readonly vdmAttributesName = vdmAttributesName;
46+
}
47+
return new Import(scope, id);
48+
}
49+
50+
public readonly vdmAttributesName: string;
51+
52+
/**
53+
* Resource ID for the Virtual Deliverablity Manager attributes
54+
*
55+
* @attribute
56+
*/
57+
public readonly vdmAttributesResourceId: string;
58+
59+
constructor(scope: Construct, id: string, props: VdmAttributesProps = {}) {
60+
super(scope, id);
61+
62+
const resource = new CfnVdmAttributes(this, 'Resource', {
63+
dashboardAttributes: {
64+
engagementMetrics: booleanToEnabledDisabled(props.engagementMetrics ?? true),
65+
},
66+
guardianAttributes: {
67+
optimizedSharedDelivery: booleanToEnabledDisabled(props.optimizedSharedDelivery ?? true),
68+
},
69+
});
70+
71+
this.vdmAttributesName = resource.ref;
72+
this.vdmAttributesResourceId = resource.attrVdmAttributesResourceId;
73+
}
74+
}
75+
76+
function booleanToEnabledDisabled(value: boolean): 'ENABLED' | 'DISABLED' {
77+
return value === true
78+
? 'ENABLED'
79+
: 'DISABLED';
80+
}

packages/@aws-cdk/aws-ses/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,8 @@
122122
"props-default-doc:@aws-cdk/aws-ses.ReceiptRuleActionConfig.s3Action",
123123
"props-default-doc:@aws-cdk/aws-ses.ReceiptRuleActionConfig.bounceAction",
124124
"props-default-doc:@aws-cdk/aws-ses.ReceiptRuleActionConfig.lambdaAction",
125-
"props-physical-name:@aws-cdk/aws-ses.EmailIdentityProps"
125+
"props-physical-name:@aws-cdk/aws-ses.EmailIdentityProps",
126+
"props-physical-name:@aws-cdk/aws-ses.VdmAttributesProps"
126127
]
127128
},
128129
"awscdkio": {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"version": "21.0.0",
3+
"files": {
4+
"21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": {
5+
"source": {
6+
"path": "VdmAttribtuesIntegDefaultTestDeployAssert44077E00.template.json",
7+
"packaging": "file"
8+
},
9+
"destinations": {
10+
"current_account-current_region": {
11+
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
12+
"objectKey": "21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22.json",
13+
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
14+
}
15+
}
16+
}
17+
},
18+
"dockerImages": {}
19+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"Parameters": {
3+
"BootstrapVersion": {
4+
"Type": "AWS::SSM::Parameter::Value<String>",
5+
"Default": "/cdk-bootstrap/hnb659fds/version",
6+
"Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]"
7+
}
8+
},
9+
"Rules": {
10+
"CheckBootstrapVersion": {
11+
"Assertions": [
12+
{
13+
"Assert": {
14+
"Fn::Not": [
15+
{
16+
"Fn::Contains": [
17+
[
18+
"1",
19+
"2",
20+
"3",
21+
"4",
22+
"5"
23+
],
24+
{
25+
"Ref": "BootstrapVersion"
26+
}
27+
]
28+
}
29+
]
30+
},
31+
"AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI."
32+
}
33+
]
34+
}
35+
}
36+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"version": "21.0.0",
3+
"files": {
4+
"93dd91bdecdbba31b81c584ffb2a1dd0ef27b71091825efee814405dc72222dd": {
5+
"source": {
6+
"path": "cdk-integ-ses-vdm-attributes.template.json",
7+
"packaging": "file"
8+
},
9+
"destinations": {
10+
"current_account-current_region": {
11+
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
12+
"objectKey": "93dd91bdecdbba31b81c584ffb2a1dd0ef27b71091825efee814405dc72222dd.json",
13+
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
14+
}
15+
}
16+
}
17+
},
18+
"dockerImages": {}
19+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
{
2+
"Resources": {
3+
"VdmD343523E": {
4+
"Type": "AWS::SES::VdmAttributes",
5+
"Properties": {
6+
"DashboardAttributes": {
7+
"EngagementMetrics": "ENABLED"
8+
},
9+
"GuardianAttributes": {
10+
"OptimizedSharedDelivery": "ENABLED"
11+
}
12+
}
13+
}
14+
},
15+
"Parameters": {
16+
"BootstrapVersion": {
17+
"Type": "AWS::SSM::Parameter::Value<String>",
18+
"Default": "/cdk-bootstrap/hnb659fds/version",
19+
"Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]"
20+
}
21+
},
22+
"Rules": {
23+
"CheckBootstrapVersion": {
24+
"Assertions": [
25+
{
26+
"Assert": {
27+
"Fn::Not": [
28+
{
29+
"Fn::Contains": [
30+
[
31+
"1",
32+
"2",
33+
"3",
34+
"4",
35+
"5"
36+
],
37+
{
38+
"Ref": "BootstrapVersion"
39+
}
40+
]
41+
}
42+
]
43+
},
44+
"AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI."
45+
}
46+
]
47+
}
48+
}
49+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"version":"21.0.0"}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"version": "21.0.0",
3+
"testCases": {
4+
"VdmAttribtuesInteg/DefaultTest": {
5+
"stacks": [
6+
"cdk-integ-ses-vdm-attributes"
7+
],
8+
"assertionStack": "VdmAttribtuesInteg/DefaultTest/DeployAssert",
9+
"assertionStackName": "VdmAttribtuesIntegDefaultTestDeployAssert44077E00"
10+
}
11+
}
12+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
{
2+
"version": "21.0.0",
3+
"artifacts": {
4+
"cdk-integ-ses-vdm-attributes.assets": {
5+
"type": "cdk:asset-manifest",
6+
"properties": {
7+
"file": "cdk-integ-ses-vdm-attributes.assets.json",
8+
"requiresBootstrapStackVersion": 6,
9+
"bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version"
10+
}
11+
},
12+
"cdk-integ-ses-vdm-attributes": {
13+
"type": "aws:cloudformation:stack",
14+
"environment": "aws://unknown-account/unknown-region",
15+
"properties": {
16+
"templateFile": "cdk-integ-ses-vdm-attributes.template.json",
17+
"validateOnSynth": false,
18+
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}",
19+
"cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}",
20+
"stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/93dd91bdecdbba31b81c584ffb2a1dd0ef27b71091825efee814405dc72222dd.json",
21+
"requiresBootstrapStackVersion": 6,
22+
"bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version",
23+
"additionalDependencies": [
24+
"cdk-integ-ses-vdm-attributes.assets"
25+
],
26+
"lookupRole": {
27+
"arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}",
28+
"requiresBootstrapStackVersion": 8,
29+
"bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version"
30+
}
31+
},
32+
"dependencies": [
33+
"cdk-integ-ses-vdm-attributes.assets"
34+
],
35+
"metadata": {
36+
"/cdk-integ-ses-vdm-attributes/Vdm/Resource": [
37+
{
38+
"type": "aws:cdk:logicalId",
39+
"data": "VdmD343523E"
40+
}
41+
],
42+
"/cdk-integ-ses-vdm-attributes/BootstrapVersion": [
43+
{
44+
"type": "aws:cdk:logicalId",
45+
"data": "BootstrapVersion"
46+
}
47+
],
48+
"/cdk-integ-ses-vdm-attributes/CheckBootstrapVersion": [
49+
{
50+
"type": "aws:cdk:logicalId",
51+
"data": "CheckBootstrapVersion"
52+
}
53+
]
54+
},
55+
"displayName": "cdk-integ-ses-vdm-attributes"
56+
},
57+
"VdmAttribtuesIntegDefaultTestDeployAssert44077E00.assets": {
58+
"type": "cdk:asset-manifest",
59+
"properties": {
60+
"file": "VdmAttribtuesIntegDefaultTestDeployAssert44077E00.assets.json",
61+
"requiresBootstrapStackVersion": 6,
62+
"bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version"
63+
}
64+
},
65+
"VdmAttribtuesIntegDefaultTestDeployAssert44077E00": {
66+
"type": "aws:cloudformation:stack",
67+
"environment": "aws://unknown-account/unknown-region",
68+
"properties": {
69+
"templateFile": "VdmAttribtuesIntegDefaultTestDeployAssert44077E00.template.json",
70+
"validateOnSynth": false,
71+
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}",
72+
"cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}",
73+
"stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22.json",
74+
"requiresBootstrapStackVersion": 6,
75+
"bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version",
76+
"additionalDependencies": [
77+
"VdmAttribtuesIntegDefaultTestDeployAssert44077E00.assets"
78+
],
79+
"lookupRole": {
80+
"arn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-lookup-role-${AWS::AccountId}-${AWS::Region}",
81+
"requiresBootstrapStackVersion": 8,
82+
"bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version"
83+
}
84+
},
85+
"dependencies": [
86+
"VdmAttribtuesIntegDefaultTestDeployAssert44077E00.assets"
87+
],
88+
"metadata": {
89+
"/VdmAttribtuesInteg/DefaultTest/DeployAssert/BootstrapVersion": [
90+
{
91+
"type": "aws:cdk:logicalId",
92+
"data": "BootstrapVersion"
93+
}
94+
],
95+
"/VdmAttribtuesInteg/DefaultTest/DeployAssert/CheckBootstrapVersion": [
96+
{
97+
"type": "aws:cdk:logicalId",
98+
"data": "CheckBootstrapVersion"
99+
}
100+
]
101+
},
102+
"displayName": "VdmAttribtuesInteg/DefaultTest/DeployAssert"
103+
},
104+
"Tree": {
105+
"type": "cdk:tree",
106+
"properties": {
107+
"file": "tree.json"
108+
}
109+
}
110+
}
111+
}

0 commit comments

Comments
 (0)