-
Notifications
You must be signed in to change notification settings - Fork 4.3k
feat(cloudfront): add NodejsEdgeFunction construct #36045
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
base: main
Are you sure you want to change the base?
feat(cloudfront): add NodejsEdgeFunction construct #36045
Conversation
Adds NodejsEdgeFunction construct that combines EdgeFunction's cross-region deployment capabilities with NodejsFunction's TypeScript bundling via esbuild. This addresses the feature request in issue #12671 by providing a convenient way to deploy TypeScript Lambda@Edge functions without manual bundling. Key features: - Extends EdgeFunction for automatic us-east-1 deployment - Reuses NodejsFunction's prepareBundling utility for esbuild integration - Validates runtime is Node.js family only - Supports all NodejsFunction bundling options (minify, sourceMap, etc.) - Includes integration test with AWS API assertions Closes #12671
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.
The pull request linter fails with the following errors:
❌ Features must contain a change to a README file.
If you believe this pull request should receive an exemption, please comment and provide a justification. A comment requesting an exemption should contain the text Exemption Request. Additionally, if clarification is needed, add Clarification Request to a comment.
a1c0bb9 to
ba8fc32
Compare
Autofix incorrectly removed the helper functions (getRuntime, findLockFile, findEntry, findDefiningFile) and broke imports. Restored all functions and fixed import paths.
…ng logic The prepareBundling function and all helper functions already exist in aws-lambda-nodejs/lib/bundling-preparation. Use them directly instead of duplicating the code.
work-in-progress
Issue # (if applicable)
Closes #12671
Reason for this change
Users requested a convenient way to deploy TypeScript Lambda@Edge functions without manual bundling. Currently, they must either:
Description of changes
Adds
NodejsEdgeFunctionconstruct that combines:Key features:
EdgeFunctionfor Lambda@Edge deployment patternsprepareBundlingutility fromlambda-nodejsto avoid code duplicationexperimentalnamespace consistent with EdgeFunctionIntegration test includes:
Description of how you validated changes
Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license