-
Notifications
You must be signed in to change notification settings - Fork 4k
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
NodejsFunction: Inconsistent SDK behavior with and without runtime specification #26459
Comments
I guess it's because the default runtime is node14 which does not come with SDK v3 yet provided in node18. aws-cdk/packages/aws-cdk-lib/aws-lambda-nodejs/lib/function.ts Lines 39 to 41 in 1b36124
And according to this, node18 runtime comes with SDK version 3.188.0 at this moment. If you need new methods that only available after 3.188.0 you probably have to bundle the latest aws js sdk into your lambda function with externals or nodeModules. |
Yes exactly @pahud, I think this is expected given the Lambda runtime defaults. |
The docs for `NodeJsFunction` say `runtime` defaults to `NODEJS_14_X` but the code defaults to `lambda.Runtime.NODEJS_18_X` (on `function.ts:104`) Closes #26459. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
|
Describe the bug
The bundled SDK is different when a runtime is specified, as opposed to when it is left as default.
Expected Behavior
The behavior of the SDK when using the default runtime value is the expected behavior.
Current Behavior
If you try to use newer methods, like the QuickSight asset export methods an error saying that the classes are not constructors.
The following is what is produced when specifying
runtime: lambda.Runtime.NODEJS_18_X
The following is what the same line produces without specifying a runtime value
Each of these produce a Lambda using the NodeJs 18 runtime.
Reproduction Steps
Deploy the following repo into an account and run the
quicksight-start-asset-export-w-runtime
andquicksight-start-asset-export
Lambdas.https://github.com/rupe120/cdk-typescript-quicksight-sdk-test
Possible Solution
Unknown
Additional Information/Context
No response
CDK CLI Version
2.88.0
Framework Version
No response
Node.js Version
v18.16.1
OS
Windows 11 Enterprise build 22621.1702
Language
Typescript
Language Version
Typescript 5.1.6
Other information
No response
The text was updated successfully, but these errors were encountered: