You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 19, 2024. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
+41-12Lines changed: 41 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -140,9 +140,48 @@ make package_lambda
140
140
```
141
141
The output of this command is a ZIP file called `lambda.zip` under the folder `.build`.
142
142
143
-
**Note:**
143
+
# Lambda Configuration
144
+
145
+
## Parametrized calls / Automation
146
+
147
+
Can pass values to your `make` command either before or after the call like below. This will fit better in a script per example to setup continuous integration in your project.
148
+
149
+
### Before `make`
144
150
145
-
Edit the `Makefile` to build a different Example by commenting the following lines and uncommenting the line relateted to the example you want to build.
151
+
```
152
+
SWIFT_EXECUTABLE=HTTPSRequest \
153
+
SWIFT_PROJECT_PATH=Examples/HTTPSRequest \
154
+
LAMBDA_FUNCTION_NAME=HTTPSRequest \
155
+
LAMBDA_HANDLER=${SWIFT_EXECUTABLE}.getHttps \
156
+
make invoke_lambda
157
+
```
158
+
159
+
### After `make`
160
+
161
+
```
162
+
make invoke_lambda \
163
+
SWIFT_EXECUTABLE=HTTPSRequest \
164
+
SWIFT_PROJECT_PATH=Examples/HTTPSRequest \
165
+
LAMBDA_FUNCTION_NAME=HTTPSRequest \
166
+
LAMBDA_HANDLER=${SWIFT_EXECUTABLE}.getHttps
167
+
```
168
+
169
+
### Parameters you can pass
170
+
171
+
| Key | Usage | Default |
172
+
| --- | --- | --- |
173
+
| AWS_BUCKET | The AWS S3 bucket where your lambda artifacts get uploaded. | my-s3-bucket |
174
+
| AWS_PROFILE | An AWS AIM profile you create to authenticate to your account. | default |
175
+
| SWIFT_VERSION | Version of Swift used / Matches Dockerfile location too from `docker/` folder. | 5.1 |
176
+
| LAYER_VERSION | Version of the Swift layer that will be created and uploaded for the Lambda to run on. | 5-1 |
177
+
| SWIFT_EXECUTABLE | Name of the binary file. | HelloWorld |
178
+
| SWIFT_PROJECT_PATH | Path to your Swift project. | Examples/HelloWorld |
179
+
| LAMBDA_FUNCTION_NAME | Display name of your Lambda in AWS. | HelloWorld |
180
+
| LAMBDA_HANDLER | Name of your lambda handler function. If you declare it using `sprinter.register(handler: "FUNCTION_NAME", lambda: syncLambda)` you should declare it as `<SWIFT_EXECUTABLE>.<FUNCTION_NAME>`. | $(SWIFT_EXECUTABLE).helloWorld |
181
+
182
+
## Manual change
183
+
184
+
You can also edit the `Makefile` to build a different Example by commenting the following lines and uncommenting the line relateted to the example you want to build.
You can also override these by passing values in the make command like below.
158
-
159
-
```
160
-
SWIFT_EXECUTABLE=HTTPSRequest \
161
-
SWIFT_PROJECT_PATH=Examples/HTTPSRequest \
162
-
LAMBDA_FUNCTION_NAME=HTTPSRequest \
163
-
LAMBDA_HANDLER=${SWIFT_EXECUTABLE}.getHttps \
164
-
make invoke_lambda
165
-
```
166
-
167
196
# Lambda Deployment Workflow
168
197
169
198
The folowing tutorial describes how to deploy the lambda in your AWS account from the command line using [AWS Command Line Interface](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-welcome.html) through the `Makefile`.
0 commit comments