diff --git a/Examples/LambdaFunctions/README.md b/Examples/LambdaFunctions/README.md index af1ad78c..9d42790f 100644 --- a/Examples/LambdaFunctions/README.md +++ b/Examples/LambdaFunctions/README.md @@ -20,7 +20,11 @@ Steps to deploy this sample to AWS Lambda using the AWS CLI: ./scripts/deploy.sh ``` - Note: This script assumes you have AWS CLI installed and credentials setup in `~/.aws/credentials`. + Notes: + - This script assumes you have AWS CLI installed and credentials setup in `~/.aws/credentials`. + - The default lambda function name is `SwiftSample`. You can specify a different one updating `lambda_name` in `deploy.sh` + - Update `s3_bucket=swift-lambda-test` in `deploy.sh` before running (AWS S3 buckets require a unique global name) + - Both lambda function and S3 bucket must exist before deploying for the first time. ### Deployment instructions using AWS SAM (Serverless Application Model) diff --git a/Examples/LambdaFunctions/scripts/deploy.sh b/Examples/LambdaFunctions/scripts/deploy.sh index b234ee6a..19db4a25 100755 --- a/Examples/LambdaFunctions/scripts/deploy.sh +++ b/Examples/LambdaFunctions/scripts/deploy.sh @@ -15,8 +15,12 @@ set -eu +# Lambda Function name (must exist in AWS Lambda) lambda_name=SwiftSample + +# S3 bucket name to upload zip file (must exist in AWS S3) s3_bucket=swift-lambda-test + executables=( $(swift package dump-package | sed -e 's|: null|: ""|g' | jq '.products[] | (select(.type.executable)) | .name' | sed -e 's|"||g') ) if [[ ${#executables[@]} = 0 ]]; then