-
Notifications
You must be signed in to change notification settings - Fork 4.2k
feat(ses): https policy for custom tracking domain #34314
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
f4a1a25
7380e6b
4b5ae9e
ee095b0
c613796
a55aacd
216ce9e
20cb832
6277f0f
285fabd
2faf046
6db3e24
56a4b83
20bb6a9
f44090d
54227c0
9af28a6
f361776
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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.
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 |
---|---|---|
@@ -0,0 +1,47 @@ | ||
{ | ||
"Resources": { | ||
"ConfigurationSet3DD38186": { | ||
"Type": "AWS::SES::ConfigurationSet", | ||
"Properties": { | ||
"TrackingOptions": { | ||
"CustomRedirectDomain": "tracking.example.com", | ||
"HttpsPolicy": "REQUIRE" | ||
} | ||
} | ||
} | ||
}, | ||
"Parameters": { | ||
"BootstrapVersion": { | ||
"Type": "AWS::SSM::Parameter::Value<String>", | ||
"Default": "/cdk-bootstrap/hnb659fds/version", | ||
"Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" | ||
} | ||
}, | ||
"Rules": { | ||
"CheckBootstrapVersion": { | ||
"Assertions": [ | ||
{ | ||
"Assert": { | ||
"Fn::Not": [ | ||
{ | ||
"Fn::Contains": [ | ||
[ | ||
"1", | ||
"2", | ||
"3", | ||
"4", | ||
"5" | ||
], | ||
{ | ||
"Ref": "BootstrapVersion" | ||
} | ||
] | ||
} | ||
] | ||
}, | ||
"AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." | ||
} | ||
] | ||
} | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import { App, Stack, StackProps } from 'aws-cdk-lib'; | ||
import * as integ from '@aws-cdk/integ-tests-alpha'; | ||
import { Construct } from 'constructs'; | ||
import * as ses from 'aws-cdk-lib/aws-ses'; | ||
|
||
/** | ||
* In order to test this you need to have a valid public hosted zone that you can use | ||
* to validate the domain identity. | ||
* | ||
* Step 1: Create a public hosted zone in Route53 | ||
* Step 2: Create a email identity in SES and validate it with the hosted zone | ||
* Step 3: Set the hosted zone name as an env var "HOSTED_ZONE_NAME" | ||
* Step 4: Run this test | ||
* Step 5: Correct the hosted zone name in the generated template to `tracking.example.com ` | ||
*/ | ||
const hostedZoneName = process.env.CDK_INTEG_HOSTED_ZONE_NAME ?? process.env.HOSTED_ZONE_NAME; | ||
if (!hostedZoneName) throw new Error('For this test you must provide your own HostedZoneName as an env var "HOSTED_ZONE_NAME". See framework-integ/README.md for details.'); | ||
|
||
interface TestStackProps extends StackProps { | ||
hostedZoneName: string; | ||
} | ||
|
||
class ConfigurationSetStack extends Stack { | ||
constructor(scope: Construct, id: string, props: TestStackProps) { | ||
super(scope, id, props); | ||
|
||
new ses.ConfigurationSet(this, 'ConfigurationSet', { | ||
customTrackingRedirectDomain: `tracking.${props.hostedZoneName}`, | ||
customTrackingHttpsPolicy: ses.HttpsPolicy.REQUIRE, | ||
}); | ||
} | ||
} | ||
|
||
const app = new App(); | ||
|
||
new integ.IntegTest(app, 'ConfigurationSetInteg', { | ||
testCases: [new ConfigurationSetStack(app, 'ses-configuration-set-tracking-options-integ', { | ||
hostedZoneName, | ||
})], | ||
stackUpdateWorkflow: false, | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wondering why disable the update workflow?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is described in here and I don't know why this is required..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see. Thanks for the pointer. Make sense to skip the update workflow as the fake hosted zone name will not deploy successfully.