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
+44-6Lines changed: 44 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -140,16 +140,54 @@ 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
144
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.
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`
150
+
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=HTTPSRequest.getHttps
167
+
```
168
+
169
+
### Parameters you can pass
170
+
171
+
| Key | Usage | Default |
172
+
| --- | --- | --- |
173
+
| AWS_PROFILE | An AWS AIM profile you create to authenticate to your account. | default |
174
+
| SWIFT_VERSION | Version of Swift used / Matches Dockerfile location too from `docker/` folder. | 5.1 |
175
+
| LAYER_VERSION | Version of the Swift layer that will be created and uploaded for the Lambda to run on. | 5-1 |
176
+
| SWIFT_EXECUTABLE | Name of the binary file. | HelloWorld |
177
+
| SWIFT_PROJECT_PATH | Path to your Swift project. | Examples/HelloWorld |
178
+
| LAMBDA_FUNCTION_NAME | Display name of your Lambda in AWS. | HelloWorld |
179
+
| 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 |
180
+
181
+
## Manual change
182
+
183
+
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.
0 commit comments