From 84477763dff63d4d42497040fbc94a0096213b7e Mon Sep 17 00:00:00 2001 From: Bill Gestrich <3207996+gestrich@users.noreply.github.com> Date: Sun, 8 May 2022 11:21:46 -0400 Subject: [PATCH] Add special Deployment instructions for the Mac M1 --- Examples/Deployment/README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Examples/Deployment/README.md b/Examples/Deployment/README.md index 33d27fc9..aca3e391 100644 --- a/Examples/Deployment/README.md +++ b/Examples/Deployment/README.md @@ -13,6 +13,13 @@ cd swift-aws-lambda-runtime/Examples/Deployment Note: The example scripts assume you have [jq](https://stedolan.github.io/jq/download/) command line tool installed. +## Mac M1 Considerations + +Lambdas will run on an x86 processor by default. Building a Lambda with an M1 will create an arm-based executable which will not run on an x86 processor. Here are a few options for building Swift Lambdas on an M1: + +1. Configure the Lambda to run on the [Graviton2](https://aws.amazon.com/blogs/aws/aws-lambda-functions-powered-by-aws-graviton2-processor-run-your-functions-on-arm-and-get-up-to-34-better-price-performance/) Arm-based processor. +2. Build with the x86 architecture by specifying `--platform linux/amd64` in all Docker 'build' and 'run' commands in `build-and-package.sh`. + ## Deployment instructions using AWS CLI Steps to deploy this sample to AWS Lambda using the AWS CLI: