forked from swift-server/swift-aws-lambda-runtime
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[doc] Getting Started documentation and tutorial (swift-server#300)
improved getting started documentation, with DocC
- Loading branch information
Showing
75 changed files
with
975 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,3 +8,4 @@ | |
xcuserdata | ||
Package.resolved | ||
.serverless | ||
.vscode |
24 changes: 24 additions & 0 deletions
24
Sources/AWSLambdaRuntimeCore/Documentation.docc/Documentation.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# ``AWSLambdaRuntimeCore`` | ||
|
||
An AWS Lambda runtime for the Swift programming language | ||
|
||
## Overview | ||
|
||
Many modern systems have client components like iOS, macOS or watchOS applications as well as server components that those clients interact with. Serverless functions are often the easiest and most efficient way for client application developers to extend their applications into the cloud. | ||
|
||
Serverless functions are increasingly becoming a popular choice for running event-driven or otherwise ad-hoc compute tasks in the cloud. They power mission critical microservices and data intensive workloads. In many cases, serverless functions allow developers to more easily scale and control compute costs given their on-demand nature. | ||
|
||
When using serverless functions, attention must be given to resource utilization as it directly impacts the costs of the system. This is where Swift shines! With its low memory footprint, deterministic performance, and quick start time, Swift is a fantastic match for the serverless functions architecture. | ||
|
||
Combine this with Swift's developer friendliness, expressiveness, and emphasis on safety, and we have a solution that is great for developers at all skill levels, scalable, and cost effective. | ||
|
||
Swift AWS Lambda Runtime was designed to make building Lambda functions in Swift simple and safe. The library is an implementation of the [AWS Lambda Runtime API](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-api.html) and uses an embedded asynchronous HTTP client based on [SwiftNIO](https://github.com/apple/swift-nio) that is fine-tuned for performance in the AWS Lambda Runtime context. The library provides a multi-tier API that allows building a range of Lambda functions: from quick and simple closures to complex, performance-sensitive event handlers. | ||
|
||
## Topics | ||
|
||
### Essentials | ||
|
||
- <doc:quick-setup> | ||
- <doc:/tutorials/table-of-content> | ||
- ``LambdaHandler`` | ||
|
2 changes: 2 additions & 0 deletions
2
Sources/AWSLambdaRuntimeCore/Documentation.docc/Resources/code/03-01-01-package-init.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Create a project directory | ||
mkdir SquareNumber && cd SquareNumber |
4 changes: 4 additions & 0 deletions
4
Sources/AWSLambdaRuntimeCore/Documentation.docc/Resources/code/03-01-02-package-init.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Create a project directory | ||
mkdir SquareNumber && cd SquareNumber | ||
# create a skeleton project | ||
swift package init --type executable |
6 changes: 6 additions & 0 deletions
6
Sources/AWSLambdaRuntimeCore/Documentation.docc/Resources/code/03-01-03-package-init.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# Create a project directory | ||
mkdir SquareNumber && cd SquareNumber | ||
# create a skeleton project | ||
swift package init --type executable | ||
# open Xcode in the current directory | ||
xed . |
8 changes: 8 additions & 0 deletions
8
Sources/AWSLambdaRuntimeCore/Documentation.docc/Resources/code/03-01-04-package-init.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Create a project directory | ||
mkdir SquareNumber && cd SquareNumber | ||
# create a skeleton project | ||
swift package init --type executable | ||
# open Xcode in the current directory | ||
xed . | ||
# alternatively, you may open VSCode | ||
code . |
8 changes: 8 additions & 0 deletions
8
Sources/AWSLambdaRuntimeCore/Documentation.docc/Resources/code/03-02-01-package.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
// swift-tools-version:5.8 | ||
// The swift-tools-version declares the minimum version of Swift required to build this package. | ||
|
||
import PackageDescription | ||
|
||
let package = Package( | ||
name: "SquareNumberLambda", | ||
) |
11 changes: 11 additions & 0 deletions
11
Sources/AWSLambdaRuntimeCore/Documentation.docc/Resources/code/03-02-02-package.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// swift-tools-version:5.8 | ||
// The swift-tools-version declares the minimum version of Swift required to build this package. | ||
|
||
import PackageDescription | ||
|
||
let package = Package( | ||
name: "SquareNumberLambda", | ||
platforms: [ | ||
.macOS(.v12), | ||
], | ||
) |
14 changes: 14 additions & 0 deletions
14
Sources/AWSLambdaRuntimeCore/Documentation.docc/Resources/code/03-02-03-package.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// swift-tools-version:5.8 | ||
// The swift-tools-version declares the minimum version of Swift required to build this package. | ||
|
||
import PackageDescription | ||
|
||
let package = Package( | ||
name: "SquareNumberLambda", | ||
platforms: [ | ||
.macOS(.v12), | ||
], | ||
dependencies: [ | ||
.package(url: "https://github.com/swift-server/swift-aws-lambda-runtime.git", from: "1.0.0-alpha"), | ||
], | ||
) |
17 changes: 17 additions & 0 deletions
17
Sources/AWSLambdaRuntimeCore/Documentation.docc/Resources/code/03-02-04-package.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// swift-tools-version:5.8 | ||
// The swift-tools-version declares the minimum version of Swift required to build this package. | ||
|
||
import PackageDescription | ||
|
||
let package = Package( | ||
name: "SquareNumberLambda", | ||
platforms: [ | ||
.macOS(.v12), | ||
], | ||
products: [ | ||
.executable(name: "SquareNumberLambda", targets: ["SquareNumberLambda"]), | ||
], | ||
dependencies: [ | ||
.package(url: "https://github.com/swift-server/swift-aws-lambda-runtime.git", from: "1.0.0-alpha"), | ||
], | ||
) |
26 changes: 26 additions & 0 deletions
26
Sources/AWSLambdaRuntimeCore/Documentation.docc/Resources/code/03-02-05-package.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// swift-tools-version:5.8 | ||
// The swift-tools-version declares the minimum version of Swift required to build this package. | ||
|
||
import PackageDescription | ||
|
||
let package = Package( | ||
name: "SquareNumberLambda", | ||
platforms: [ | ||
.macOS(.v12), | ||
], | ||
products: [ | ||
.executable(name: "SquareNumberLambda", targets: ["SquareNumberLambda"]), | ||
], | ||
dependencies: [ | ||
.package(url: "https://github.com/swift-server/swift-aws-lambda-runtime.git", from: "1.0.0-alpha"), | ||
], | ||
targets: [ | ||
.executableTarget( | ||
name: "SquareNumberLambda", | ||
dependencies: [ | ||
.product(name: "AWSLambdaRuntime", package: "swift-aws-lambda-runtime"), | ||
], | ||
path: "." | ||
), | ||
] | ||
) |
3 changes: 3 additions & 0 deletions
3
Sources/AWSLambdaRuntimeCore/Documentation.docc/Resources/code/03-03-01-main.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
|
||
@main | ||
struct SquareNumberHandler: SimpleLambdaHandler {} |
4 changes: 4 additions & 0 deletions
4
Sources/AWSLambdaRuntimeCore/Documentation.docc/Resources/code/03-03-02-main.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import AWSLambdaRuntime | ||
|
||
@main | ||
struct SquareNumberHandler: SimpleLambdaHandler {} |
6 changes: 6 additions & 0 deletions
6
Sources/AWSLambdaRuntimeCore/Documentation.docc/Resources/code/03-03-03-main.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import AWSLambdaRuntime | ||
|
||
@main | ||
struct SquareNumberHandler: SimpleLambdaHandler { | ||
func handle(_ event: Event, context: LambdaContext) async throws -> Output {} | ||
} |
14 changes: 14 additions & 0 deletions
14
Sources/AWSLambdaRuntimeCore/Documentation.docc/Resources/code/03-03-04-main.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import AWSLambdaRuntime | ||
|
||
struct Input: Codable { | ||
let number: Double | ||
} | ||
|
||
struct Number: Codable { | ||
let result: Double | ||
} | ||
|
||
@main | ||
struct SquareNumberHandler: SimpleLambdaHandler { | ||
func handle(_ event: Event, context: LambdaContext) async throws -> Output {} | ||
} |
17 changes: 17 additions & 0 deletions
17
Sources/AWSLambdaRuntimeCore/Documentation.docc/Resources/code/03-03-05-main.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import AWSLambdaRuntime | ||
|
||
struct Input: Codable { | ||
let number: Double | ||
} | ||
|
||
struct Number: Codable { | ||
let result: Double | ||
} | ||
|
||
@main | ||
struct SquareNumberHandler: SimpleLambdaHandler { | ||
typealias Event = Input | ||
typealias Output = Number | ||
|
||
func handle(_ event: Event, context: LambdaContext) async throws -> Output {} | ||
} |
19 changes: 19 additions & 0 deletions
19
Sources/AWSLambdaRuntimeCore/Documentation.docc/Resources/code/03-03-06-main.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import AWSLambdaRuntime | ||
|
||
struct Input: Codable { | ||
let number: Double | ||
} | ||
|
||
struct Number: Codable { | ||
let result: Double | ||
} | ||
|
||
@main | ||
struct SquareNumberHandler: SimpleLambdaHandler { | ||
typealias Event = Input | ||
typealias Output = Number | ||
|
||
func handle(_ event: Event, context: LambdaContext) async throws -> Output { | ||
Number(result: event.number * event.number) | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
Sources/AWSLambdaRuntimeCore/Documentation.docc/Resources/code/03-04-03-console-output.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
2023-04-14T11:42:21+0200 info LocalLambdaServer : [AWSLambdaRuntimeCore] LocalLambdaServer started and listening on 127.0.0.1:7000, receiving events on /invoke | ||
2023-04-14T11:42:21+0200 info Lambda : [AWSLambdaRuntimeCore] lambda runtime starting with LambdaConfiguration | ||
General(logLevel: info)) | ||
Lifecycle(id: 104957691689708, maxTimes: 0, stopSignal: TERM) | ||
RuntimeEngine(ip: 127.0.0.1, port: 7000, requestTimeout: nil |
5 changes: 5 additions & 0 deletions
5
Sources/AWSLambdaRuntimeCore/Documentation.docc/Resources/code/03-04-04-curl.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
curl --header "Content-Type: application/json" \ | ||
--request POST \ | ||
--data '{"number": 3}' \ | ||
http://localhost:7000/invoke | ||
|
6 changes: 6 additions & 0 deletions
6
Sources/AWSLambdaRuntimeCore/Documentation.docc/Resources/code/03-04-05-curl.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
curl --header "Content-Type: application/json" \ | ||
--request POST \ | ||
--data '{"number": 3}' \ | ||
http://localhost:7000/invoke | ||
|
||
{"result":9} |
2 changes: 2 additions & 0 deletions
2
Sources/AWSLambdaRuntimeCore/Documentation.docc/Resources/code/03-04-06-terminal.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export LOCAL_LAMBDA_SERVER_ENABLED=true | ||
|
2 changes: 2 additions & 0 deletions
2
Sources/AWSLambdaRuntimeCore/Documentation.docc/Resources/code/03-04-07-terminal.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export LOCAL_LAMBDA_SERVER_ENABLED=true | ||
swift run |
10 changes: 10 additions & 0 deletions
10
Sources/AWSLambdaRuntimeCore/Documentation.docc/Resources/code/03-04-08-terminal.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
export LOCAL_LAMBDA_SERVER_ENABLED=true | ||
swift run | ||
|
||
Building for debugging... | ||
Build complete! (0.20s) | ||
2023-04-14T10:52:25+0200 info LocalLambdaServer : [AWSLambdaRuntimeCore] LocalLambdaServer started and listening on 127.0.0.1:7000, receiving events on /invoke | ||
2023-04-14T10:52:25+0200 info Lambda : [AWSLambdaRuntimeCore] lambda runtime starting with LambdaConfiguration | ||
General(logLevel: info)) | ||
Lifecycle(id: 102943961260250, maxTimes: 0, stopSignal: TERM) | ||
RuntimeEngine(ip: 127.0.0.1, port: 7000, requestTimeout: nil |
2 changes: 2 additions & 0 deletions
2
Sources/AWSLambdaRuntimeCore/Documentation.docc/Resources/code/04-01-02-plugin-archive.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
swift package --disable-sandbox plugin archive | ||
|
19 changes: 19 additions & 0 deletions
19
Sources/AWSLambdaRuntimeCore/Documentation.docc/Resources/code/04-01-03-plugin-archive.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
swift package --disable-sandbox plugin archive | ||
|
||
------------------------------------------------------------------------- | ||
building "squarenumberlambda" in docker | ||
------------------------------------------------------------------------- | ||
updating "swift:amazonlinux2" docker image | ||
amazonlinux2: Pulling from library/swift | ||
Digest: sha256:5b0cbe56e35210fa90365ba3a4db9cd2b284a5b74d959fc1ee56a13e9c35b378 | ||
Status: Image is up to date for swift:amazonlinux2 | ||
docker.io/library/swift:amazonlinux2 | ||
building "SquareNumberLambda" | ||
Building for production... | ||
... | ||
------------------------------------------------------------------------- | ||
archiving "SquareNumberLambda" | ||
------------------------------------------------------------------------- | ||
1 archive created | ||
* SquareNumberLambda at /Users/YourUserName/SquareNumberLambda/.build/plugins/AWSLambdaPackager/outputs/AWSLambdaPackager/SquareNumberLambda/SquareNumberLambda.zip | ||
|
21 changes: 21 additions & 0 deletions
21
Sources/AWSLambdaRuntimeCore/Documentation.docc/Resources/code/04-01-04-plugin-archive.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
swift package --disable-sandbox plugin archive | ||
|
||
------------------------------------------------------------------------- | ||
building "squarenumberlambda" in docker | ||
------------------------------------------------------------------------- | ||
updating "swift:amazonlinux2" docker image | ||
amazonlinux2: Pulling from library/swift | ||
Digest: sha256:5b0cbe56e35210fa90365ba3a4db9cd2b284a5b74d959fc1ee56a13e9c35b378 | ||
Status: Image is up to date for swift:amazonlinux2 | ||
docker.io/library/swift:amazonlinux2 | ||
building "SquareNumberLambda" | ||
Building for production... | ||
... | ||
------------------------------------------------------------------------- | ||
archiving "SquareNumberLambda" | ||
------------------------------------------------------------------------- | ||
1 archive created | ||
* SquareNumberLambda at /Users/YourUserName/SquareNumberLambda/.build/plugins/AWSLambdaPackager/outputs/AWSLambdaPackager/SquareNumberLambda/SquareNumberLambda.zip | ||
|
||
|
||
cp .build/plugins/AWSLambdaPackager/outputs/AWSLambdaPackager/SquareNumberLambda/SquareNumberLambda.zip ~/Desktop |
1 change: 1 addition & 0 deletions
1
Sources/AWSLambdaRuntimeCore/Documentation.docc/Resources/code/04-03-01-aws-cli.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
aws --version |
7 changes: 7 additions & 0 deletions
7
...s/AWSLambdaRuntimeCore/Documentation.docc/Resources/code/04-03-02-lambda-invoke-hidden.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# | ||
# --region the AWS Region to send the command | ||
# --function-name the name of your function | ||
# --cli-binary-format tells the cli to use raw data as input (default is base64) | ||
# --payload the payload to pass to your function code | ||
# result.json the name of the file to store the response from the function | ||
|
14 changes: 14 additions & 0 deletions
14
Sources/AWSLambdaRuntimeCore/Documentation.docc/Resources/code/04-03-02-lambda-invoke.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# | ||
# --region the AWS Region to send the command | ||
# --function-name the name of your function | ||
# --cli-binary-format tells the cli to use raw data as input (default is base64) | ||
# --payload the payload to pass to your function code | ||
# result.json the name of the file to store the response from the function | ||
|
||
aws lambda invoke \ | ||
--region us-west-2 \ | ||
--function-name SquaredNumberLambda \ | ||
--cli-binary-format raw-in-base64-out \ | ||
--payload '{"number":3}' \ | ||
result.json | ||
|
18 changes: 18 additions & 0 deletions
18
Sources/AWSLambdaRuntimeCore/Documentation.docc/Resources/code/04-03-03-lambda-invoke.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# | ||
# --region the AWS Region to send the command | ||
# --function-name the name of your function | ||
# --cli-binary-format tells the cli to use raw data as input (default is base64) | ||
# --payload the payload to pass to your function code | ||
# result.json the name of the file to store the response from the function | ||
|
||
aws lambda invoke \ | ||
--region us-west-2 \ | ||
--function-name SquaredNumberLambda \ | ||
--cli-binary-format raw-in-base64-out \ | ||
--payload '{"number":3}' \ | ||
result.json | ||
|
||
{ | ||
"StatusCode": 200, | ||
"ExecutedVersion": "$LATEST" | ||
} |
20 changes: 20 additions & 0 deletions
20
Sources/AWSLambdaRuntimeCore/Documentation.docc/Resources/code/04-03-04-lambda-invoke.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# | ||
# --region the AWS Region to send the command | ||
# --function-name the name of your function | ||
# --cli-binary-format tells the cli to use raw data as input (default is base64) | ||
# --payload the payload to pass to your function code | ||
# result.json the name of the file to store the response from the function | ||
|
||
aws lambda invoke \ | ||
--region us-west-2 \ | ||
--function-name SquaredNumberLambda \ | ||
--cli-binary-format raw-in-base64-out \ | ||
--payload '{"number":3}' \ | ||
result.json | ||
|
||
{ | ||
"StatusCode": 200, | ||
"ExecutedVersion": "$LATEST" | ||
} | ||
|
||
cat result.json |
22 changes: 22 additions & 0 deletions
22
Sources/AWSLambdaRuntimeCore/Documentation.docc/Resources/code/04-03-05-lambda-invoke.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# | ||
# --region the AWS Region to send the command | ||
# --function-name the name of your function | ||
# --cli-binary-format tells the cli to use raw data as input (default is base64) | ||
# --payload the payload to pass to your function code | ||
# result.json the name of the file to store the response from the function | ||
|
||
aws lambda invoke \ | ||
--region us-west-2 \ | ||
--function-name SquaredNumberLambda \ | ||
--cli-binary-format raw-in-base64-out \ | ||
--payload '{"number":3}' \ | ||
result.json | ||
|
||
{ | ||
"StatusCode": 200, | ||
"ExecutedVersion": "$LATEST" | ||
} | ||
|
||
cat result.json | ||
{"result":9} | ||
|
Binary file added
BIN
+73.1 KB
...LambdaRuntimeCore/Documentation.docc/Resources/tutorials/00-swift_on_lambda.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+557 KB
...LambdaRuntimeCore/Documentation.docc/Resources/tutorials/01-swift_on_lambda.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+286 KB
...timeCore/Documentation.docc/Resources/tutorials/03-01-terminal-package-init.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+399 KB
.../AWSLambdaRuntimeCore/Documentation.docc/Resources/tutorials/03-01-xcode@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+458 KB
...ambdaRuntimeCore/Documentation.docc/Resources/tutorials/03-01-xcode~dark@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+301 KB
...timeCore/Documentation.docc/Resources/tutorials/03-02-swift-package-manager.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+32.4 KB
...aRuntimeCore/Documentation.docc/Resources/tutorials/03-03-01-rename-file@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+33.9 KB
...imeCore/Documentation.docc/Resources/tutorials/03-03-01-rename-file~dark@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+557 KB
...daRuntimeCore/Documentation.docc/Resources/tutorials/03-03-swift-code-xcode.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+125 KB
...aRuntimeCore/Documentation.docc/Resources/tutorials/03-04-01-edit-scheme@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+154 KB
...imeCore/Documentation.docc/Resources/tutorials/03-04-01-edit-scheme~dark@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+139 KB
...RuntimeCore/Documentation.docc/Resources/tutorials/03-04-02-add-variable@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+140 KB
...meCore/Documentation.docc/Resources/tutorials/03-04-02-add-variable~dark@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+94.8 KB
...LambdaRuntimeCore/Documentation.docc/Resources/tutorials/03-04-test-locally.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+111 KB
...LambdaRuntimeCore/Documentation.docc/Resources/tutorials/03-swift_on_lambda.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+104 KB
...ntimeCore/Documentation.docc/Resources/tutorials/04-01-01-docker-started@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1.12 MB
...aRuntimeCore/Documentation.docc/Resources/tutorials/04-01-compile-for-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+137 KB
...untimeCore/Documentation.docc/Resources/tutorials/04-02-01-console-login@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+85.9 KB
...untimeCore/Documentation.docc/Resources/tutorials/04-02-02-console-login@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+214 KB
...untimeCore/Documentation.docc/Resources/tutorials/04-02-03-select-region@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+196 KB
...untimeCore/Documentation.docc/Resources/tutorials/04-02-04-select-lambda@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+156 KB
...timeCore/Documentation.docc/Resources/tutorials/04-02-05-create-function@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+154 KB
...ore/Documentation.docc/Resources/tutorials/04-02-05-create-function~dark@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+311 KB
...timeCore/Documentation.docc/Resources/tutorials/04-02-06-create-function@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+311 KB
...ore/Documentation.docc/Resources/tutorials/04-02-06-create-function~dark@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+229 KB
...daRuntimeCore/Documentation.docc/Resources/tutorials/04-02-07-upload-zip@2x.png
Oops, something went wrong.
Binary file added
BIN
+226 KB
...timeCore/Documentation.docc/Resources/tutorials/04-02-07-upload-zip~dark@2x.png
Oops, something went wrong.
Binary file added
BIN
+68.3 KB
...daRuntimeCore/Documentation.docc/Resources/tutorials/04-02-08-upload-zip@2x.png
Oops, something went wrong.
Binary file added
BIN
+67.8 KB
...timeCore/Documentation.docc/Resources/tutorials/04-02-08-upload-zip~dark@2x.png
Oops, something went wrong.
Binary file added
BIN
+210 KB
...aRuntimeCore/Documentation.docc/Resources/tutorials/04-02-09-test-lambda@2x.png
Oops, something went wrong.
Binary file added
BIN
+210 KB
...imeCore/Documentation.docc/Resources/tutorials/04-02-09-test-lambda~dark@2x.png
Oops, something went wrong.
Binary file added
BIN
+326 KB
...eCore/Documentation.docc/Resources/tutorials/04-02-10-test-lambda-result@2x.png
Oops, something went wrong.
Binary file added
BIN
+324 KB
.../Documentation.docc/Resources/tutorials/04-02-10-test-lambda-result~dark@2x.png
Oops, something went wrong.
Binary file added
BIN
+378 KB
...ambdaRuntimeCore/Documentation.docc/Resources/tutorials/04-02-create-lambda.png
Oops, something went wrong.
Binary file added
BIN
+379 KB
...ambdaRuntimeCore/Documentation.docc/Resources/tutorials/04-03-invoke-lambda.png
Oops, something went wrong.
Binary file added
BIN
+273 KB
...LambdaRuntimeCore/Documentation.docc/Resources/tutorials/04-swift_on_lambda.png
Oops, something went wrong.
Oops, something went wrong.