Describe the bug
Hello guys,
After recent changes, my cdk deploy stopped working. I have a few lambdas declared as following:
const myLambda = new NodejsFunction(this, 'Example', {
entry: join(__dirname, `/../../some/path.ts`),
runtime: Runtime.NODEJS_18_X,
architecture: Architecture.ARM_64,
memorySize: 256,
bundling: {
minify: true,
externalModules: ['@aws-sdk/client-dynamodb']
}
})
I use architecture: Architecture.ARM_64 to save some costs. On my desktop machine I have Ubuntu Linux (amd64 architecture). So when I type cdk deploy MyStack it launches sam build command for every lambda function. Docker images are starting to download, I see the following line:
--> Command: docker build -t cdk-e46d15a7662e461d1d19a3c4b3874cda9ae1d1d3f77bb3e2068a7e2c5d164204 --platform "linux/arm64" --build-arg "IMAGE=public.ecr.aws/sam/build-nodejs18.x" --build-arg "ESBUILD_VERSION=0" "/home/r007/Projects/my-project/node_modules/aws-cdk-lib/aws-lambda-nodejs/lib"
Notice the --platform "linux/arm64" flag.
It fails on the very first command:
> [ 2/10] RUN npm install --global yarn@1.22.5:
0.333 exec /bin/sh: exec format error
Because of the incompatibility of ARM64 architecture with AMD64.
Expected Behavior
It should not use target architecture for building JavaScript code. It worked just fine before I updated cdk dependency.
Current Behavior
It fails with error message exec /bin/sh: exec format error
Reproduction Steps
- Create
NodejsFunction with any content.
- Use
architecture: Architecture.ARM_64.
- Do
cdk deploy.
Possible Solution
No response
Additional Information/Context
No response
CDK CLI Version
2.99.1 (build b2a895e)
Framework Version
No response
Node.js Version
v18.17.1
OS
Ubuntu 22.04.3 LTS
Language
Typescript
Language Version
No response
Other information
No response
Describe the bug
Hello guys,
After recent changes, my
cdk deploystopped working. I have a few lambdas declared as following:I use
architecture: Architecture.ARM_64to save some costs. On my desktop machine I have Ubuntu Linux (amd64 architecture). So when I typecdk deploy MyStackit launches sam build command for every lambda function. Docker images are starting to download, I see the following line:Notice the
--platform "linux/arm64"flag.It fails on the very first command:
Because of the incompatibility of ARM64 architecture with AMD64.
Expected Behavior
It should not use target architecture for building JavaScript code. It worked just fine before I updated cdk dependency.
Current Behavior
It fails with error message
exec /bin/sh: exec format errorReproduction Steps
NodejsFunctionwith any content.architecture: Architecture.ARM_64.cdk deploy.Possible Solution
No response
Additional Information/Context
No response
CDK CLI Version
2.99.1 (build b2a895e)
Framework Version
No response
Node.js Version
v18.17.1
OS
Ubuntu 22.04.3 LTS
Language
Typescript
Language Version
No response
Other information
No response