(synthetics): Canary code building similar to aws-cdk-lib/aws-lambda-nodejs/NodejsFunction #22271
Labels
@aws-cdk/aws-synthetics
Related to Amazon CloudWatch Synthetics
effort/medium
Medium work item – several days of effort
feature-request
A feature should be added or improved.
p2
wontfix
We have determined that we will not resolve the issue.
Describe the feature
The developer experience of writing Cloudwatch Synthetics canary scripts would be much nicer if support was provided for "packaging" the script code in a similar manner to NodejsFunction available when implementing lambda functions using typescript or javascript.
Adopting the same mechanism for canary scripts would
This would also allow developers to not know or care about the internals of Cloudwatch Synthetics runtime and the need for having the canary scripts under nodejs/node_modules directory.
Use Case
Needing to place canary javascript files under node_modules directory makes script development quite painful. The need to package them under nodejs/node_modules is a runtime detail that shouldn't affect how the source code is organized during development. One could of course use something like Gulp to implement the "packaging" and potential typescript compilation of canary scripts into a directory with the required nodejs/node_modules structure. But this seems like something that CDK could solve for all by applying the same mechanisms used in aws-cdk-lib/aws-lambda-nodejs/NodejsFunction
Proposed Solution
Copy-paste of aws-cdk-lib/aws-lambda-nodejs/NodejsFunction into something that accepts nodejs and typescript source in any directory structure the developer desires and deploys the javascript canary scripts in whatever directory structure the Cloudwatch Synthetics service requires.
Other Information
No response
Acknowledgements
CDK version used
2.43.0
Environment details (OS name and version, etc.)
macOs Monterey
The text was updated successfully, but these errors were encountered: