From 79a2dd26fcdd804131ea22dcee01d6b4a84e271b Mon Sep 17 00:00:00 2001 From: Pahud Hsieh Date: Wed, 7 Aug 2024 15:33:41 +0000 Subject: [PATCH 1/3] improve doc --- packages/aws-cdk-lib/aws-lambda/README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/aws-cdk-lib/aws-lambda/README.md b/packages/aws-cdk-lib/aws-lambda/README.md index 58dc34ef74d53..2ab488c932438 100644 --- a/packages/aws-cdk-lib/aws-lambda/README.md +++ b/packages/aws-cdk-lib/aws-lambda/README.md @@ -78,6 +78,10 @@ configurations as well as choosing a specific tag or digest. See their docs for To deploy a `DockerImageFunction` on Lambda `arm64` architecture, specify `Architecture.ARM_64` in `architecture`. This will bundle docker image assets for `arm64` architecture with `--platform linux/arm64` even if build within an `x86_64` host. +With that being said, if you are bundling `DockerImageFunction` for Lambda `amd64` architecture from a `arm64` machine like a Macbook, you would +need to specify `architecture: lambda.Architecture.X86_64` as well. This ensures the `--platform` argument is passed to the image assests +bundling process so you can bundle up `X86_64` images from the `arm64` machine. + ```ts new lambda.DockerImageFunction(this, 'AssetFunction', { code: lambda.DockerImageCode.fromImageAsset(path.join(__dirname, 'docker-arm64-handler')), From 1de4c10e72495320f055cc0dd732a37bf4b4f298 Mon Sep 17 00:00:00 2001 From: Pahud Hsieh Date: Wed, 7 Aug 2024 15:39:00 +0000 Subject: [PATCH 2/3] minor --- packages/aws-cdk-lib/aws-lambda/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/aws-cdk-lib/aws-lambda/README.md b/packages/aws-cdk-lib/aws-lambda/README.md index 2ab488c932438..054bb787a884f 100644 --- a/packages/aws-cdk-lib/aws-lambda/README.md +++ b/packages/aws-cdk-lib/aws-lambda/README.md @@ -78,7 +78,7 @@ configurations as well as choosing a specific tag or digest. See their docs for To deploy a `DockerImageFunction` on Lambda `arm64` architecture, specify `Architecture.ARM_64` in `architecture`. This will bundle docker image assets for `arm64` architecture with `--platform linux/arm64` even if build within an `x86_64` host. -With that being said, if you are bundling `DockerImageFunction` for Lambda `amd64` architecture from a `arm64` machine like a Macbook, you would +With that being said, if you are bundling `DockerImageFunction` for Lambda `amd64` architecture from a `arm64` machine like a Macbook with `arm64` CPU, you would need to specify `architecture: lambda.Architecture.X86_64` as well. This ensures the `--platform` argument is passed to the image assests bundling process so you can bundle up `X86_64` images from the `arm64` machine. From d8458301ac340590dca467b058022bd53abbc202 Mon Sep 17 00:00:00 2001 From: Pahud Hsieh Date: Wed, 28 Aug 2024 11:14:06 -0400 Subject: [PATCH 3/3] Update packages/aws-cdk-lib/aws-lambda/README.md Co-authored-by: Grace Luo <54298030+gracelu0@users.noreply.github.com> --- packages/aws-cdk-lib/aws-lambda/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/aws-cdk-lib/aws-lambda/README.md b/packages/aws-cdk-lib/aws-lambda/README.md index 054bb787a884f..94c36ae9f21a3 100644 --- a/packages/aws-cdk-lib/aws-lambda/README.md +++ b/packages/aws-cdk-lib/aws-lambda/README.md @@ -79,7 +79,7 @@ To deploy a `DockerImageFunction` on Lambda `arm64` architecture, specify `Archi This will bundle docker image assets for `arm64` architecture with `--platform linux/arm64` even if build within an `x86_64` host. With that being said, if you are bundling `DockerImageFunction` for Lambda `amd64` architecture from a `arm64` machine like a Macbook with `arm64` CPU, you would -need to specify `architecture: lambda.Architecture.X86_64` as well. This ensures the `--platform` argument is passed to the image assests +need to specify `architecture: lambda.Architecture.X86_64` as well. This ensures the `--platform` argument is passed to the image assets bundling process so you can bundle up `X86_64` images from the `arm64` machine. ```ts