Skip to content

Add special Deployment instructions for the Mac M1 #263

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

Merged
merged 1 commit into from
May 9, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Examples/Deployment/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This information seems to apply to all types of deployments here (CLI, SAM, Serverless) so I made a special section for it. For an M1 user, this information is really critical.

## 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:
Expand Down