|
123 | 123 |
|
124 | 124 | More details on how to code a Swift Lambda are documented under the Examples folder:
|
125 | 125 |
|
126 |
| -- [HelloWorld](https://github.com/swift-sprinter/aws-lambda-swift-sprinter/Examples/HelloWorld) |
127 |
| -- [HTTPSRequest](https://github.com/swift-sprinter/aws-lambda-swift-sprinter/Examples/HTTPSRequest) |
128 |
| -- [S3Test](https://github.com/swift-sprinter/aws-lambda-swift-sprinter/Examples/S3Test) |
| 126 | +- [HelloWorld](https://github.com/swift-sprinter/aws-lambda-swift-sprinter/blob/master/Examples/HelloWorld) |
| 127 | +- [HTTPSRequest](https://github.com/swift-sprinter/aws-lambda-swift-sprinter/blob/master/Examples/HTTPSRequest) |
| 128 | +- [S3Test](https://github.com/swift-sprinter/aws-lambda-swift-sprinter/blob/master/Examples/S3Test) |
129 | 129 |
|
130 | 130 | Refer to the [LambdaSwiftSprinter framework documentation](https://github.com/swift-sprinter/aws-lambda-swift-sprinter-core) to know more.
|
131 | 131 |
|
@@ -358,6 +358,46 @@ make upload_lambda_layer
|
358 | 358 | make update_lambda
|
359 | 359 | ```
|
360 | 360 |
|
| 361 | +# Manual deployment from AWS Console |
| 362 | + |
| 363 | +### Requirements: |
| 364 | +- Use MacOS or Linux |
| 365 | +- Install [Docker](https://docs.docker.com/docker-for-mac/install/) |
| 366 | +- Clone the repo `git clone https://github.com/swift-sprinter/aws-lambda-swift-sprinter.git` |
| 367 | + |
| 368 | +### Build: |
| 369 | +- From command line run `make docker_build` |
| 370 | +- From command line run `make package_layer` |
| 371 | +- From command line run `make package_lambda` |
| 372 | + |
| 373 | +### Configure: |
| 374 | +- Go to `AWS Lambda -> Layers` in AWS Console and create a new layer from scratch |
| 375 | +- Enter layer name "swift-lambda-runtime-5-1-1" |
| 376 | +- Upload the zip file `build/swift-lambda-runtime-5-1-1.zip` |
| 377 | +- Leave "Compatible runtimes" empty. |
| 378 | +- Click "Create" |
| 379 | +- Copy the `arn` from the created layer, it's required to set up the lambda. |
| 380 | +- Go to `AWS Lambda` in AWS Console and create a new function from scratch |
| 381 | +- Enter function name "benchmark-swift-hello" and select "Provide your own bootstrap" as runtime |
| 382 | +- Choose the execution role created above |
| 383 | +- Upload the zip file created with function code, it can be found under `build/lambda.zip` |
| 384 | +- Input "HelloWorld.helloWorld" in "Handler" (`Executable.Handler`) |
| 385 | +- Click "Layers" |
| 386 | +- Click "Add Layer" |
| 387 | +- Click "Provide a layer version" |
| 388 | +- Add the `arn` of the layer you have uploaded previously. |
| 389 | +- Click "Add" |
| 390 | +- Click "Save" |
| 391 | + |
| 392 | +### Test: |
| 393 | +- Test the function by clicking `Test` in the top right corner and add the following event: |
| 394 | +``` |
| 395 | +{ |
| 396 | + "name": "Swift-Sprinter" |
| 397 | +} |
| 398 | +``` |
| 399 | +- Give a name to the event, save and then test it. |
| 400 | + |
361 | 401 | # Contributions
|
362 | 402 |
|
363 | 403 | Contributions are more than welcome! Follow [this guide](https://github.com/swift-sprinter/aws-lambda-swift-sprinter/blob/master/CONTRIBUTING.md) to contribute.
|
|
0 commit comments