Open petetnt opened 8 months ago
I guess this is because the default bundling base image is sam/build-nodejs18.x
while you are deploying to v20 lambda runtime and this might require you to specify ARG IMAGE=
point to v20 for better compatibility.
As far as I understand, setting the runtime parameter to Runtime.NODEJS20_X does exactly that, it sets the IMAGE ARG to sam/build-nodejs18.x. I am not familiar enough with the internals of aws-cdk though.
The issue went away after updating to MacOS Sonoma 14.2.1, which seem to point similar kinds of OpenSSL issues as with https://github.com/aws/aws-sam-build-images/issues/116 but I don't think one can pass build args anyway.
Next run did hang on RUN npm install --global --unsafe-perm=true esbuild@0
once, but one more try helped
I guess this is because the default bundling base image is
sam/build-nodejs18.x
while you are deploying to v20 lambda runtime and this might require you to specifyARG IMAGE=
point to v20 for better compatibility.
This is not correct - the IMAGE argument is set automatically depending on the runtime selected. You can see in the log that the image being used is public.ecr.aws/sam/build-nodejs20.x
Describe the bug
I am trying to run
cdk
commands, such ascdk diff
on a stack that containsNodejsFunction
s withruntime
s set toRuntime.NODEJS_20_X
. However, the commands always hang when the build image,public.ecr.aws/sam/build-nodejs20.x@sha256:f09695497aac919ac48544640265
tries to installyarn
:If
runtime
is set toRuntime.NODEJS_18_X
, yarn is installed correctly.Also if one just takes the Dockerfile from https://github.com/aws/aws-cdk/blob/main/packages/aws-cdk-lib/aws-lambda-nodejs/lib/Dockerfile and sets ARG IMAGE=IMAGE=public.ecr.aws/sam/build-nodejs20.x, the
yarn
install step completes successfully.Expected Behavior
Yarn is installed within seconds and the build continues.
Current Behavior
RUN npm install --global yarn@1.22.5
step continues indefinitelyReproduction Steps
Create a project that has a
NodeJSFunction
in it:Run
cdk diff --profile myprofile
Possible Solution
No response
Additional Information/Context
Might be related to https://github.com/aws/aws-sam-build-images/issues/116
CDK CLI Version
2.118.0 (build a40f2ec)
Framework Version
2.117.0
Node.js Version
v20.10.0
OS
macOS 13.1
Language
TypeScript
Language Version
No response
Other information
No response