Skip to content

Commit 9249546

Browse files
authored
feat(ssl-server-test): use durable Lambda function (#324)
Use a durable Lambda function instead of a Step Function. Switch to the API v4. Now requires an registered email. BREAKING CHANGE: `SslServerTest` now requires a `registrationEmail` to run.
1 parent 580daac commit 9249546

File tree

46 files changed

+853
-1205
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+853
-1205
lines changed

.eslintrc.json

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.gitattributes

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.gitignore

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.projen/deps.json

Lines changed: 13 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.projen/files.json

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.projen/tasks.json

Lines changed: 2 additions & 23 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.projenrc.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,15 @@ const project = new awscdk.AwsCdkConstructLibrary({
77
authorAddress: 'jonathan.goldwasser@gmail.com',
88
description: 'High-level constructs for AWS CDK',
99
jsiiVersion: '5.x',
10-
cdkVersion: '2.133.0',
10+
cdkVersion: '2.232.0',
1111
name: 'cloudstructs',
1212
projenrcTs: true,
13+
tsJestOptions: { transformOptions: { isolatedModules: true } },
1314
peerDeps: [],
1415
bundledDeps: [
15-
'got',
16+
'@aws/durable-execution-sdk-js',
1617
'@slack/web-api',
18+
'got',
1719
'mjml',
1820
],
1921
devDeps: [
@@ -26,8 +28,10 @@ const project = new awscdk.AwsCdkConstructLibrary({
2628
'@aws-sdk/client-s3',
2729
'@aws-sdk/client-secrets-manager',
2830
'@aws-sdk/client-sfn',
31+
'@aws-sdk/client-sns',
2932
'@aws-sdk/client-textract',
3033
'@aws-sdk/lib-dynamodb',
34+
'@aws/durable-execution-sdk-js-testing',
3135
'@types/aws-lambda',
3236
'@types/mjml',
3337
'@types/tsscmp',
@@ -77,7 +81,7 @@ const packageExports: Record<string, string> = {
7781
'./.jsii': './.jsii',
7882
};
7983
for (const dirent of fs.readdirSync('./src', { withFileTypes: true })) {
80-
if (dirent.isDirectory()) {
84+
if (dirent.isDirectory() && dirent.name !== 'utils') {
8185
const construct = dirent.name;
8286
// TODO: remove "lib" when TypeScript supports "exports"
8387
packageExports[`./lib/${construct}`] = `./lib/${construct}/index.js`;

API.md

Lines changed: 19 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 8 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/ssl-server-test/README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,28 +19,28 @@ export class MyStack extends Stack {
1919
super(scope, id, props);
2020

2121
new SslServerTest(this, 'TestMyHost', {
22+
registrationEmail: 'jdoe@someorganizationemail.com',
2223
host: 'my.host'
2324
});
2425
}
2526
}
2627
```
2728

28-
This will create a state machine that will run a SSL server test everyday. By default, a SNS topic is
29-
created and a notification is sent to this topic if the [grade](https://github.com/ssllabs/research/wiki/SSL-Server-Rating-Guide)
29+
This will create a durable Lambda function that will run a SSL server test everyday. By default, a SNS
30+
topic is created and a notification is sent to this topic if the [grade](https://github.com/ssllabs/research/wiki/SSL-Server-Rating-Guide)
3031
of the test is below `A+`. The content of the notification is the
31-
[test result returned by the API](https://github.com/ssllabs/ssllabs-scan/blob/master/ssllabs-api-docs-v3.md#response-objects).
32+
[test result returned by the API](https://github.com/ssllabs/ssllabs-scan/blob/master/ssllabs-api-docs-v4.md#response-objects).
33+
34+
A [free registration](https://github.com/ssllabs/ssllabs-scan/blob/master/ssllabs-api-docs-v4.md#register-for-scan-api-initiation-and-result-fetching) is required to use the the SSL Labs API.
3235

3336
```ts
3437
const myTest = new SslServerTest(this, 'MyTest', {
38+
registrationEmail: 'jdoe@someorganizationemail.com',
3539
host: 'my.host',
3640
});
3741

3842
myTest.alarmTopic.addSubscription(/* your subscription here */)
3943
```
4044

41-
Use the `minimumGrade`, `alarmTopic` or `schedule` props to customize the
45+
Use the `minimumGrade`, `alarmTopic` or `scheduleExpression` props to customize the
4246
behavior of the construct.
43-
44-
<p align="center">
45-
<img src="ssl-server-test.svg" width="50%">
46-
</p>

0 commit comments

Comments
 (0)