Skip to content
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

feat(synthetics): CloudWatch Synthetics NodeJS Pupeteer 6.0 Runtime with NodeJS 18 #27339

Merged
merged 4 commits into from
Sep 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions packages/aws-cdk-lib/aws-synthetics/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const canary = new synthetics.Canary(this, 'MyCanary', {
code: synthetics.Code.fromAsset(path.join(__dirname, 'canary')),
handler: 'index.handler',
}),
runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_4_0,
runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_6_0,
environmentVariables: {
stage: 'prod',
},
Expand Down Expand Up @@ -110,7 +110,7 @@ const canary = new synthetics.Canary(this, 'Canary', {
code: synthetics.Code.fromInline('/* Synthetics handler code'),
}),
cleanup: synthetics.Cleanup.LAMBDA,
runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_4_0,
runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_6_0,
});
```

Expand All @@ -136,7 +136,7 @@ new synthetics.Canary(this, 'Inline Canary', {
code: synthetics.Code.fromInline('/* Synthetics handler code */'),
handler: 'index.handler', // must be 'index.handler'
}),
runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_4_0,
runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_6_0,
});

// To supply the code from your local filesystem:
Expand All @@ -145,7 +145,7 @@ new synthetics.Canary(this, 'Asset Canary', {
code: synthetics.Code.fromAsset(path.join(__dirname, 'canary')),
handler: 'index.handler', // must end with '.handler'
}),
runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_4_0,
runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_6_0,
});

// To supply the code from a S3 bucket:
Expand All @@ -156,7 +156,7 @@ new synthetics.Canary(this, 'Bucket Canary', {
code: synthetics.Code.fromBucket(bucket, 'canary.zip'),
handler: 'index.handler', // must end with '.handler'
}),
runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_4_0,
runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_6_0,
});
```

Expand Down Expand Up @@ -195,7 +195,7 @@ new synthetics.Canary(this, 'Vpc Canary', {
code: synthetics.Code.fromAsset(path.join(__dirname, 'canary')),
handler: 'index.handler',
}),
runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_4_0,
runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_6_0,
vpc,
});
```
Expand Down Expand Up @@ -242,7 +242,7 @@ const canary = new synthetics.Canary(this, 'MyCanary', {
code: synthetics.Code.fromAsset(path.join(__dirname, 'canary')),
handler: 'index.handler',
}),
runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_4_0,
runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_6_0,
artifactsBucketLifecycleRules: [{
expiration: Duration.days(30),
}],
Expand Down
15 changes: 15 additions & 0 deletions packages/aws-cdk-lib/aws-synthetics/lib/runtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,21 @@ export class Runtime {
*/
public static readonly SYNTHETICS_NODEJS_PUPPETEER_5_1 = new Runtime('syn-nodejs-puppeteer-5.1', RuntimeFamily.NODEJS);

/**
* `syn-nodejs-puppeteer-6.0` includes the following:
* - Lambda runtime Node.js 18.x
* - Puppeteer-core version 19.7.0
* - Chromium version 111.0.5563.146
*
* New Features:
* - **Dependency upgrade**: The Node.js dependency is upgraded to 18.x.
* Bug fixes:
* - **Bug fix**: Clean up core dump generated when Chromium crashes during a canary run.
*
* @see https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Library_nodejs_puppeteer.html#CloudWatch_Synthetics_runtimeversion-nodejs-puppeteer-6.0
*/
public static readonly SYNTHETICS_NODEJS_PUPPETEER_6_0 = new Runtime('syn-nodejs-puppeteer-6.0', RuntimeFamily.NODEJS);

/**
* `syn-python-selenium-1.0` includes the following:
* - Lambda runtime Python 3.8
Expand Down
6 changes: 3 additions & 3 deletions packages/aws-cdk-lib/aws-synthetics/test/canary.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -749,7 +749,7 @@ describe('handler validation', () => {
handler: 'invalidHandler',
code: synthetics.Code.fromAsset(path.join(__dirname, 'canaries')),
}),
runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_3_9,
runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_6_0,
});
}).toThrow(/Canary Handler must be specified either as 'fileName.handler', 'fileName.functionName', or 'folder\/fileName.functionName'/);

Expand All @@ -759,7 +759,7 @@ describe('handler validation', () => {
handler: 'canary.functionName',
code: synthetics.Code.fromAsset(path.join(__dirname, 'canaries')),
}),
runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_3_9,
runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_6_0,
});
}).not.toThrow();

Expand All @@ -769,7 +769,7 @@ describe('handler validation', () => {
handler: 'folder/canary.functionName',
code: synthetics.Code.fromAsset(path.join(__dirname, 'canaries')),
}),
runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_3_9,
runtime: synthetics.Runtime.SYNTHETICS_NODEJS_PUPPETEER_6_0,
});
}).not.toThrow();
});
Expand Down