mirror of
https://github.com/swift-server/swift-aws-lambda-runtime.git
synced 2026-05-03 07:22:27 +00:00
change references from /swift-server to /awslabs (#591)
Change Examples, README, and doc to refer to https://github.org/awslabs instead of https://github.org/swift-server --------- Co-authored-by: Sebastien Stormacq <stormacq@amazon.lu>
This commit is contained in:
committed by
GitHub
parent
8116ba3023
commit
dee635267b
+1
-1
@@ -65,4 +65,4 @@ We require that your commit messages match our template. The easiest way to do t
|
||||
|
||||
## How to contribute your work
|
||||
|
||||
Please open a pull request at https://github.com/swift-server/swift-aws-lambda-runtime. Make sure the CI passes, and then wait for code review.
|
||||
Please open a pull request at https://github.com/awslabs/swift-aws-lambda-runtime. Make sure the CI passes, and then wait for code review.
|
||||
|
||||
@@ -13,8 +13,8 @@ let package = Package(
|
||||
],
|
||||
dependencies: [
|
||||
// during CI, the dependency on local version of swift-aws-lambda-runtime is added dynamically below
|
||||
.package(url: "https://github.com/swift-server/swift-aws-lambda-runtime.git", from: "2.0.0"),
|
||||
.package(url: "https://github.com/swift-server/swift-aws-lambda-events.git", from: "1.0.0"),
|
||||
.package(url: "https://github.com/awslabs/swift-aws-lambda-runtime.git", from: "2.0.0"),
|
||||
.package(url: "https://github.com/awslabs/swift-aws-lambda-events.git", from: "1.0.0"),
|
||||
],
|
||||
targets: [
|
||||
.executableTarget(
|
||||
@@ -37,7 +37,7 @@ if let localDepsPath = Context.environment["LAMBDA_USE_LOCAL_DEPS"],
|
||||
let indexToRemove = package.dependencies.firstIndex { dependency in
|
||||
if case .sourceControl(
|
||||
name: _,
|
||||
location: "https://github.com/swift-server/swift-aws-lambda-runtime.git",
|
||||
location: "https://github.com/awslabs/swift-aws-lambda-runtime.git",
|
||||
requirement: _
|
||||
) = dependency.kind {
|
||||
return true
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
This is a simple example of an AWS Lambda function invoked through an Amazon API Gateway V1.
|
||||
|
||||
> [!NOTE]
|
||||
> This example uses the API Gateway V1 `Rest Api` endpoint type, whereas the [API Gateway V2](https://github.com/swift-server/swift-aws-lambda-runtime/tree/main/Examples/APIGateway) example uses the `HttpApi` endpoint type. For more information, see [Choose between REST APIs and HTTP APIs](https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-vs-rest.html).
|
||||
> This example uses the API Gateway V1 `Rest Api` endpoint type, whereas the [API Gateway V2](https://github.com/awslabs/swift-aws-lambda-runtime/tree/main/Examples/APIGateway) example uses the `HttpApi` endpoint type. For more information, see [Choose between REST APIs and HTTP APIs](https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-vs-rest.html).
|
||||
|
||||
## Code
|
||||
|
||||
@@ -17,7 +17,7 @@ The handler is `(event: APIGatewayRequest, context: LambdaContext) -> APIGateway
|
||||
|
||||
The function must return a `APIGatewayResponse`.
|
||||
|
||||
`APIGatewayRequest` and `APIGatewayResponse` are defined in the [Swift AWS Lambda Events](https://github.com/swift-server/swift-aws-lambda-events) library.
|
||||
`APIGatewayRequest` and `APIGatewayResponse` are defined in the [Swift AWS Lambda Events](https://github.com/awslabs/swift-aws-lambda-events) library.
|
||||
|
||||
## Build & Package
|
||||
|
||||
@@ -149,4 +149,4 @@ These are example applications for demonstration purposes. When deploying such i
|
||||
- Ensure that AWS Lambda function is configured for function-level concurrent execution limit ([concurrency documentation](https://docs.aws.amazon.com/lambda/latest/dg/lambda-concurrency.html), [configuration guide](https://docs.aws.amazon.com/lambda/latest/dg/configuration-concurrency.html))
|
||||
- Check encryption settings for Lambda environment variables ([documentation](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars-encryption.html))
|
||||
- Ensure that AWS Lambda function is configured for a Dead Letter Queue (DLQ) ([documentation](https://docs.aws.amazon.com/lambda/latest/dg/invocation-async-retain-records.html#invocation-dlq))
|
||||
- Ensure that AWS Lambda function is configured inside a VPC when it needs to access private resources ([documentation](https://docs.aws.amazon.com/lambda/latest/dg/configuration-vpc.html), [code example](https://github.com/swift-server/swift-aws-lambda-runtime/tree/main/Examples/ServiceLifecycle%2BPostgres))
|
||||
- Ensure that AWS Lambda function is configured inside a VPC when it needs to access private resources ([documentation](https://docs.aws.amazon.com/lambda/latest/dg/configuration-vpc.html), [code example](https://github.com/awslabs/swift-aws-lambda-runtime/tree/main/Examples/ServiceLifecycle%2BPostgres))
|
||||
@@ -16,7 +16,7 @@ Description: SAM Template for APIGateway Lambda Example
|
||||
# See: https://docs.aws.amazon.com/lambda/latest/dg/invocation-async-retain-records.html#invocation-dlq
|
||||
# - Ensure that AWS Lambda function is configured inside a VPC when it needs to access private resources
|
||||
# See: https://docs.aws.amazon.com/lambda/latest/dg/configuration-vpc.html
|
||||
# Code Example: https://github.com/swift-server/swift-aws-lambda-runtime/tree/main/Examples/ServiceLifecycle%2BPostgres
|
||||
# Code Example: https://github.com/awslabs/swift-aws-lambda-runtime/tree/main/Examples/ServiceLifecycle%2BPostgres
|
||||
|
||||
Resources:
|
||||
# Lambda function
|
||||
|
||||
@@ -14,8 +14,8 @@ let package = Package(
|
||||
],
|
||||
dependencies: [
|
||||
// during CI, the dependency on local version of swift-aws-lambda-runtime is added dynamically below
|
||||
.package(url: "https://github.com/swift-server/swift-aws-lambda-runtime.git", from: "2.0.0"),
|
||||
.package(url: "https://github.com/swift-server/swift-aws-lambda-events.git", from: "1.0.0"),
|
||||
.package(url: "https://github.com/awslabs/swift-aws-lambda-runtime.git", from: "2.0.0"),
|
||||
.package(url: "https://github.com/awslabs/swift-aws-lambda-events.git", from: "1.0.0"),
|
||||
],
|
||||
targets: [
|
||||
.executableTarget(
|
||||
@@ -44,7 +44,7 @@ if let localDepsPath = Context.environment["LAMBDA_USE_LOCAL_DEPS"],
|
||||
let indexToRemove = package.dependencies.firstIndex { dependency in
|
||||
if case .sourceControl(
|
||||
name: _,
|
||||
location: "https://github.com/swift-server/swift-aws-lambda-runtime.git",
|
||||
location: "https://github.com/awslabs/swift-aws-lambda-runtime.git",
|
||||
requirement: _
|
||||
) = dependency.kind {
|
||||
return true
|
||||
|
||||
@@ -119,4 +119,4 @@ These are example applications for demonstration purposes. When deploying such i
|
||||
- Ensure that AWS Lambda function is configured for function-level concurrent execution limit ([concurrency documentation](https://docs.aws.amazon.com/lambda/latest/dg/lambda-concurrency.html), [configuration guide](https://docs.aws.amazon.com/lambda/latest/dg/configuration-concurrency.html))
|
||||
- Check encryption settings for Lambda environment variables ([documentation](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars-encryption.html))
|
||||
- Ensure that AWS Lambda function is configured for a Dead Letter Queue (DLQ) ([documentation](https://docs.aws.amazon.com/lambda/latest/dg/invocation-async-retain-records.html#invocation-dlq))
|
||||
- Ensure that AWS Lambda function is configured inside a VPC when it needs to access private resources ([documentation](https://docs.aws.amazon.com/lambda/latest/dg/configuration-vpc.html), [code example](https://github.com/swift-server/swift-aws-lambda-runtime/tree/main/Examples/ServiceLifecycle%2BPostgres))
|
||||
- Ensure that AWS Lambda function is configured inside a VPC when it needs to access private resources ([documentation](https://docs.aws.amazon.com/lambda/latest/dg/configuration-vpc.html), [code example](https://github.com/awslabs/swift-aws-lambda-runtime/tree/main/Examples/ServiceLifecycle%2BPostgres))
|
||||
@@ -16,7 +16,7 @@ Description: SAM Template for APIGateway Lambda Example
|
||||
# See: https://docs.aws.amazon.com/lambda/latest/dg/invocation-async-retain-records.html#invocation-dlq
|
||||
# - Ensure that AWS Lambda function is configured inside a VPC when it needs to access private resources
|
||||
# See: https://docs.aws.amazon.com/lambda/latest/dg/configuration-vpc.html
|
||||
# Code Example: https://github.com/swift-server/swift-aws-lambda-runtime/tree/main/Examples/ServiceLifecycle%2BPostgres
|
||||
# Code Example: https://github.com/awslabs/swift-aws-lambda-runtime/tree/main/Examples/ServiceLifecycle%2BPostgres
|
||||
|
||||
Resources:
|
||||
# The API Gateway
|
||||
|
||||
@@ -13,8 +13,8 @@ let package = Package(
|
||||
],
|
||||
dependencies: [
|
||||
// during CI, the dependency on local version of swift-aws-lambda-runtime is added dynamically below
|
||||
.package(url: "https://github.com/swift-server/swift-aws-lambda-runtime.git", from: "2.0.0"),
|
||||
.package(url: "https://github.com/swift-server/swift-aws-lambda-events.git", from: "1.0.0"),
|
||||
.package(url: "https://github.com/awslabs/swift-aws-lambda-runtime.git", from: "2.0.0"),
|
||||
.package(url: "https://github.com/awslabs/swift-aws-lambda-events.git", from: "1.0.0"),
|
||||
],
|
||||
targets: [
|
||||
.executableTarget(
|
||||
@@ -37,7 +37,7 @@ if let localDepsPath = Context.environment["LAMBDA_USE_LOCAL_DEPS"],
|
||||
let indexToRemove = package.dependencies.firstIndex { dependency in
|
||||
if case .sourceControl(
|
||||
name: _,
|
||||
location: "https://github.com/swift-server/swift-aws-lambda-runtime.git",
|
||||
location: "https://github.com/awslabs/swift-aws-lambda-runtime.git",
|
||||
requirement: _
|
||||
) = dependency.kind {
|
||||
return true
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
This is a simple example of an AWS Lambda function invoked through an Amazon HTTPS API Gateway.
|
||||
|
||||
> [!NOTE]
|
||||
> This example uses the API Gateway V2 `Http Api` endpoint type, whereas the [API Gateway V1](https://github.com/swift-server/swift-aws-lambda-runtime/tree/main/Examples/APIGatewayV1) example uses the `Rest Api` endpoint type. For more information, see [Choose between REST APIs and HTTP APIs](https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-vs-rest.html).
|
||||
> This example uses the API Gateway V2 `Http Api` endpoint type, whereas the [API Gateway V1](https://github.com/awslabs/swift-aws-lambda-runtime/tree/main/Examples/APIGatewayV1) example uses the `Rest Api` endpoint type. For more information, see [Choose between REST APIs and HTTP APIs](https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-vs-rest.html).
|
||||
|
||||
## Code
|
||||
|
||||
@@ -17,7 +17,7 @@ The handler is `(event: APIGatewayV2Request, context: LambdaContext) -> APIGatew
|
||||
|
||||
The function must return a `APIGatewayV2Response`.
|
||||
|
||||
`APIGatewayV2Request` and `APIGatewayV2Response` are defined in the [Swift AWS Lambda Events](https://github.com/swift-server/swift-aws-lambda-events) library.
|
||||
`APIGatewayV2Request` and `APIGatewayV2Response` are defined in the [Swift AWS Lambda Events](https://github.com/awslabs/swift-aws-lambda-events) library.
|
||||
|
||||
## Build & Package
|
||||
|
||||
@@ -134,4 +134,4 @@ These are example applications for demonstration purposes. When deploying such i
|
||||
- Ensure that AWS Lambda function is configured for function-level concurrent execution limit ([concurrency documentation](https://docs.aws.amazon.com/lambda/latest/dg/lambda-concurrency.html), [configuration guide](https://docs.aws.amazon.com/lambda/latest/dg/configuration-concurrency.html))
|
||||
- Check encryption settings for Lambda environment variables ([documentation](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars-encryption.html))
|
||||
- Ensure that AWS Lambda function is configured for a Dead Letter Queue (DLQ) ([documentation](https://docs.aws.amazon.com/lambda/latest/dg/invocation-async-retain-records.html#invocation-dlq))
|
||||
- Ensure that AWS Lambda function is configured inside a VPC when it needs to access private resources ([documentation](https://docs.aws.amazon.com/lambda/latest/dg/configuration-vpc.html), [code example](https://github.com/swift-server/swift-aws-lambda-runtime/tree/main/Examples/ServiceLifecycle%2BPostgres))
|
||||
- Ensure that AWS Lambda function is configured inside a VPC when it needs to access private resources ([documentation](https://docs.aws.amazon.com/lambda/latest/dg/configuration-vpc.html), [code example](https://github.com/awslabs/swift-aws-lambda-runtime/tree/main/Examples/ServiceLifecycle%2BPostgres))
|
||||
@@ -16,7 +16,7 @@ Description: SAM Template for APIGateway Lambda Example
|
||||
# See: https://docs.aws.amazon.com/lambda/latest/dg/invocation-async-retain-records.html#invocation-dlq
|
||||
# - Ensure that AWS Lambda function is configured inside a VPC when it needs to access private resources
|
||||
# See: https://docs.aws.amazon.com/lambda/latest/dg/configuration-vpc.html
|
||||
# Code Example: https://github.com/swift-server/swift-aws-lambda-runtime/tree/main/Examples/ServiceLifecycle%2BPostgres
|
||||
# Code Example: https://github.com/awslabs/swift-aws-lambda-runtime/tree/main/Examples/ServiceLifecycle%2BPostgres
|
||||
|
||||
Resources:
|
||||
# Lambda function
|
||||
|
||||
@@ -13,7 +13,7 @@ let package = Package(
|
||||
],
|
||||
dependencies: [
|
||||
// during CI, the dependency on local version of swift-aws-lambda-runtime is added dynamically below
|
||||
.package(url: "https://github.com/swift-server/swift-aws-lambda-runtime.git", from: "2.0.0")
|
||||
.package(url: "https://github.com/awslabs/swift-aws-lambda-runtime.git", from: "2.0.0")
|
||||
],
|
||||
targets: [
|
||||
.executableTarget(
|
||||
@@ -35,7 +35,7 @@ if let localDepsPath = Context.environment["LAMBDA_USE_LOCAL_DEPS"],
|
||||
let indexToRemove = package.dependencies.firstIndex { dependency in
|
||||
if case .sourceControl(
|
||||
name: _,
|
||||
location: "https://github.com/swift-server/swift-aws-lambda-runtime.git",
|
||||
location: "https://github.com/awslabs/swift-aws-lambda-runtime.git",
|
||||
requirement: _
|
||||
) = dependency.kind {
|
||||
return true
|
||||
|
||||
@@ -126,4 +126,4 @@ These are example applications for demonstration purposes. When deploying such i
|
||||
- Ensure that AWS Lambda function is configured for function-level concurrent execution limit ([concurrency documentation](https://docs.aws.amazon.com/lambda/latest/dg/lambda-concurrency.html), [configuration guide](https://docs.aws.amazon.com/lambda/latest/dg/configuration-concurrency.html))
|
||||
- Check encryption settings for Lambda environment variables ([documentation](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars-encryption.html))
|
||||
- Ensure that AWS Lambda function is configured for a Dead Letter Queue (DLQ) ([documentation](https://docs.aws.amazon.com/lambda/latest/dg/invocation-async-retain-records.html#invocation-dlq))
|
||||
- Ensure that AWS Lambda function is configured inside a VPC when it needs to access private resources ([documentation](https://docs.aws.amazon.com/lambda/latest/dg/configuration-vpc.html), [code example](https://github.com/swift-server/swift-aws-lambda-runtime/tree/main/Examples/ServiceLifecycle%2BPostgres))
|
||||
- Ensure that AWS Lambda function is configured inside a VPC when it needs to access private resources ([documentation](https://docs.aws.amazon.com/lambda/latest/dg/configuration-vpc.html), [code example](https://github.com/awslabs/swift-aws-lambda-runtime/tree/main/Examples/ServiceLifecycle%2BPostgres))
|
||||
@@ -13,8 +13,8 @@ let package = Package(
|
||||
],
|
||||
dependencies: [
|
||||
// during CI, the dependency on local version of swift-aws-lambda-runtime is added dynamically below
|
||||
.package(url: "https://github.com/swift-server/swift-aws-lambda-runtime.git", from: "2.0.0"),
|
||||
.package(url: "https://github.com/swift-server/swift-aws-lambda-events.git", from: "1.0.0"),
|
||||
.package(url: "https://github.com/awslabs/swift-aws-lambda-runtime.git", from: "2.0.0"),
|
||||
.package(url: "https://github.com/awslabs/swift-aws-lambda-events.git", from: "1.0.0"),
|
||||
],
|
||||
targets: [
|
||||
.executableTarget(
|
||||
@@ -37,7 +37,7 @@ if let localDepsPath = Context.environment["LAMBDA_USE_LOCAL_DEPS"],
|
||||
let indexToRemove = package.dependencies.firstIndex { dependency in
|
||||
if case .sourceControl(
|
||||
name: _,
|
||||
location: "https://github.com/swift-server/swift-aws-lambda-runtime.git",
|
||||
location: "https://github.com/awslabs/swift-aws-lambda-runtime.git",
|
||||
requirement: _
|
||||
) = dependency.kind {
|
||||
return true
|
||||
|
||||
@@ -128,4 +128,4 @@ These are example applications for demonstration purposes. When deploying such i
|
||||
- Ensure that AWS Lambda function is configured for function-level concurrent execution limit ([concurrency documentation](https://docs.aws.amazon.com/lambda/latest/dg/lambda-concurrency.html), [configuration guide](https://docs.aws.amazon.com/lambda/latest/dg/configuration-concurrency.html))
|
||||
- Check encryption settings for Lambda environment variables ([documentation](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars-encryption.html))
|
||||
- Ensure that AWS Lambda function is configured for a Dead Letter Queue (DLQ) ([documentation](https://docs.aws.amazon.com/lambda/latest/dg/invocation-async-retain-records.html#invocation-dlq))
|
||||
- Ensure that AWS Lambda function is configured inside a VPC when it needs to access private resources ([documentation](https://docs.aws.amazon.com/lambda/latest/dg/configuration-vpc.html), [code example](https://github.com/swift-server/swift-aws-lambda-runtime/tree/main/Examples/ServiceLifecycle%2BPostgres))
|
||||
- Ensure that AWS Lambda function is configured inside a VPC when it needs to access private resources ([documentation](https://docs.aws.amazon.com/lambda/latest/dg/configuration-vpc.html), [code example](https://github.com/awslabs/swift-aws-lambda-runtime/tree/main/Examples/ServiceLifecycle%2BPostgres))
|
||||
@@ -14,7 +14,7 @@ let package = Package(
|
||||
dependencies: [
|
||||
// during CI, the dependency on local version of swift-aws-lambda-runtime is added dynamically below
|
||||
.package(
|
||||
url: "https://github.com/swift-server/swift-aws-lambda-runtime.git",
|
||||
url: "https://github.com/awslabs/swift-aws-lambda-runtime.git",
|
||||
from: "2.0.0"
|
||||
)
|
||||
],
|
||||
@@ -37,7 +37,7 @@ if let localDepsPath = Context.environment["LAMBDA_USE_LOCAL_DEPS"],
|
||||
let indexToRemove = package.dependencies.firstIndex { dependency in
|
||||
if case .sourceControl(
|
||||
name: _,
|
||||
location: "https://github.com/swift-server/swift-aws-lambda-runtime.git",
|
||||
location: "https://github.com/awslabs/swift-aws-lambda-runtime.git",
|
||||
requirement: _
|
||||
) = dependency.kind {
|
||||
return true
|
||||
|
||||
@@ -87,4 +87,4 @@ These are example applications for demonstration purposes. When deploying such i
|
||||
- Ensure that AWS Lambda function is configured for function-level concurrent execution limit ([concurrency documentation](https://docs.aws.amazon.com/lambda/latest/dg/lambda-concurrency.html), [configuration guide](https://docs.aws.amazon.com/lambda/latest/dg/configuration-concurrency.html))
|
||||
- Check encryption settings for Lambda environment variables ([documentation](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars-encryption.html))
|
||||
- Ensure that AWS Lambda function is configured for a Dead Letter Queue (DLQ) ([documentation](https://docs.aws.amazon.com/lambda/latest/dg/invocation-async-retain-records.html#invocation-dlq))
|
||||
- Ensure that AWS Lambda function is configured inside a VPC when it needs to access private resources ([documentation](https://docs.aws.amazon.com/lambda/latest/dg/configuration-vpc.html), [code example](https://github.com/swift-server/swift-aws-lambda-runtime/tree/main/Examples/ServiceLifecycle%2BPostgres))
|
||||
- Ensure that AWS Lambda function is configured inside a VPC when it needs to access private resources ([documentation](https://docs.aws.amazon.com/lambda/latest/dg/configuration-vpc.html), [code example](https://github.com/awslabs/swift-aws-lambda-runtime/tree/main/Examples/ServiceLifecycle%2BPostgres))
|
||||
@@ -18,7 +18,7 @@ let package = Package(
|
||||
],
|
||||
dependencies: [
|
||||
// during CI, the dependency on local version of swift-aws-lambda-runtime is added dynamically below
|
||||
.package(url: "https://github.com/swift-server/swift-aws-lambda-runtime.git", from: "2.0.0")
|
||||
.package(url: "https://github.com/awslabs/swift-aws-lambda-runtime.git", from: "2.0.0")
|
||||
],
|
||||
targets: [
|
||||
.executableTarget(
|
||||
@@ -40,7 +40,7 @@ if let localDepsPath = Context.environment["LAMBDA_USE_LOCAL_DEPS"],
|
||||
let indexToRemove = package.dependencies.firstIndex { dependency in
|
||||
if case .sourceControl(
|
||||
name: _,
|
||||
location: "https://github.com/swift-server/swift-aws-lambda-runtime.git",
|
||||
location: "https://github.com/awslabs/swift-aws-lambda-runtime.git",
|
||||
requirement: _
|
||||
) = dependency.kind {
|
||||
return true
|
||||
|
||||
@@ -110,4 +110,4 @@ These are example applications for demonstration purposes. When deploying such i
|
||||
- Ensure that AWS Lambda function is configured for function-level concurrent execution limit ([concurrency documentation](https://docs.aws.amazon.com/lambda/latest/dg/lambda-concurrency.html), [configuration guide](https://docs.aws.amazon.com/lambda/latest/dg/configuration-concurrency.html))
|
||||
- Check encryption settings for Lambda environment variables ([documentation](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars-encryption.html))
|
||||
- Ensure that AWS Lambda function is configured for a Dead Letter Queue (DLQ) ([documentation](https://docs.aws.amazon.com/lambda/latest/dg/invocation-async-retain-records.html#invocation-dlq))
|
||||
- Ensure that AWS Lambda function is configured inside a VPC when it needs to access private resources ([documentation](https://docs.aws.amazon.com/lambda/latest/dg/configuration-vpc.html), [code example](https://github.com/swift-server/swift-aws-lambda-runtime/tree/main/Examples/ServiceLifecycle%2BPostgres))
|
||||
- Ensure that AWS Lambda function is configured inside a VPC when it needs to access private resources ([documentation](https://docs.aws.amazon.com/lambda/latest/dg/configuration-vpc.html), [code example](https://github.com/awslabs/swift-aws-lambda-runtime/tree/main/Examples/ServiceLifecycle%2BPostgres))
|
||||
@@ -13,7 +13,7 @@ let package = Package(
|
||||
],
|
||||
dependencies: [
|
||||
// during CI, the dependency on local version of swift-aws-lambda-runtime is added dynamically below
|
||||
.package(url: "https://github.com/swift-server/swift-aws-lambda-runtime.git", from: "2.0.0", traits: [])
|
||||
.package(url: "https://github.com/awslabs/swift-aws-lambda-runtime.git", from: "2.0.0", traits: [])
|
||||
],
|
||||
targets: [
|
||||
.executableTarget(
|
||||
@@ -35,7 +35,7 @@ if let localDepsPath = Context.environment["LAMBDA_USE_LOCAL_DEPS"],
|
||||
let indexToRemove = package.dependencies.firstIndex { dependency in
|
||||
if case .sourceControl(
|
||||
name: _,
|
||||
location: "https://github.com/swift-server/swift-aws-lambda-runtime.git",
|
||||
location: "https://github.com/awslabs/swift-aws-lambda-runtime.git",
|
||||
requirement: _
|
||||
) = dependency.kind {
|
||||
return true
|
||||
|
||||
@@ -26,7 +26,7 @@ This example disables all the traits. To disable one or several traits, modify `
|
||||
|
||||
```swift
|
||||
dependencies: [
|
||||
.package(url: "https://github.com/swift-server/swift-aws-lambda-runtime.git", from: "2.0.0-beta", traits: [])
|
||||
.package(url: "https://github.com/awslabs/swift-aws-lambda-runtime.git", from: "2.0.0-beta", traits: [])
|
||||
],
|
||||
```
|
||||
|
||||
@@ -114,4 +114,4 @@ These are example applications for demonstration purposes. When deploying such i
|
||||
- Ensure that AWS Lambda function is configured for function-level concurrent execution limit ([concurrency documentation](https://docs.aws.amazon.com/lambda/latest/dg/lambda-concurrency.html), [configuration guide](https://docs.aws.amazon.com/lambda/latest/dg/configuration-concurrency.html))
|
||||
- Check encryption settings for Lambda environment variables ([documentation](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars-encryption.html))
|
||||
- Ensure that AWS Lambda function is configured for a Dead Letter Queue (DLQ) ([documentation](https://docs.aws.amazon.com/lambda/latest/dg/invocation-async-retain-records.html#invocation-dlq))
|
||||
- Ensure that AWS Lambda function is configured inside a VPC when it needs to access private resources ([documentation](https://docs.aws.amazon.com/lambda/latest/dg/configuration-vpc.html), [code example](https://github.com/swift-server/swift-aws-lambda-runtime/tree/main/Examples/ServiceLifecycle%2BPostgres))
|
||||
- Ensure that AWS Lambda function is configured inside a VPC when it needs to access private resources ([documentation](https://docs.aws.amazon.com/lambda/latest/dg/configuration-vpc.html), [code example](https://github.com/awslabs/swift-aws-lambda-runtime/tree/main/Examples/ServiceLifecycle%2BPostgres))
|
||||
@@ -11,14 +11,14 @@ let package = Package(
|
||||
platforms: [.macOS(.v15)],
|
||||
dependencies: [
|
||||
.package(
|
||||
url: "https://github.com/swift-server/swift-aws-lambda-runtime.git",
|
||||
url: "https://github.com/awslabs/swift-aws-lambda-runtime.git",
|
||||
from: "2.0.0"
|
||||
),
|
||||
.package(
|
||||
url: "https://github.com/hummingbird-project/hummingbird-lambda.git",
|
||||
branch: "main"
|
||||
),
|
||||
.package(url: "https://github.com/swift-server/swift-aws-lambda-events.git", from: "1.1.0"),
|
||||
.package(url: "https://github.com/awslabs/swift-aws-lambda-events.git", from: "1.1.0"),
|
||||
],
|
||||
targets: [
|
||||
.executableTarget(
|
||||
@@ -40,7 +40,7 @@ if let localDepsPath = Context.environment["LAMBDA_USE_LOCAL_DEPS"],
|
||||
let indexToRemove = package.dependencies.firstIndex { dependency in
|
||||
if case .sourceControl(
|
||||
name: _,
|
||||
location: "https://github.com/swift-server/swift-aws-lambda-runtime.git",
|
||||
location: "https://github.com/awslabs/swift-aws-lambda-runtime.git",
|
||||
requirement: _
|
||||
) = dependency.kind {
|
||||
return true
|
||||
|
||||
@@ -10,7 +10,7 @@ The code creates a `Router` with `AppRequestContext` (which is a type alias for
|
||||
|
||||
The `APIGatewayV2LambdaFunction` wraps the Hummingbird router to make it compatible with AWS Lambda and API Gateway V2 events.
|
||||
|
||||
`APIGatewayV2Request` is defined in the [Swift AWS Lambda Events](https://github.com/swift-server/swift-aws-lambda-events) library, and the Hummingbird Lambda integration is provided by the [Hummingbird Lambda](https://github.com/hummingbird-project/hummingbird-lambda) package.
|
||||
`APIGatewayV2Request` is defined in the [Swift AWS Lambda Events](https://github.com/awslabs/swift-aws-lambda-events) library, and the Hummingbird Lambda integration is provided by the [Hummingbird Lambda](https://github.com/hummingbird-project/hummingbird-lambda) package.
|
||||
|
||||
## Build & Package
|
||||
|
||||
@@ -87,4 +87,4 @@ These are example applications for demonstration purposes. When deploying such i
|
||||
- Ensure that AWS Lambda function is configured for function-level concurrent execution limit ([concurrency documentation](https://docs.aws.amazon.com/lambda/latest/dg/lambda-concurrency.html), [configuration guide](https://docs.aws.amazon.com/lambda/latest/dg/configuration-concurrency.html))
|
||||
- Check encryption settings for Lambda environment variables ([documentation](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars-encryption.html))
|
||||
- Ensure that AWS Lambda function is configured for a Dead Letter Queue (DLQ) ([documentation](https://docs.aws.amazon.com/lambda/latest/dg/invocation-async-retain-records.html#invocation-dlq))
|
||||
- Ensure that AWS Lambda function is configured inside a VPC when it needs to access private resources ([documentation](https://docs.aws.amazon.com/lambda/latest/dg/configuration-vpc.html), [code example](https://github.com/swift-server/swift-aws-lambda-runtime/tree/main/Examples/ServiceLifecycle%2BPostgres))
|
||||
- Ensure that AWS Lambda function is configured inside a VPC when it needs to access private resources ([documentation](https://docs.aws.amazon.com/lambda/latest/dg/configuration-vpc.html), [code example](https://github.com/awslabs/swift-aws-lambda-runtime/tree/main/Examples/ServiceLifecycle%2BPostgres))
|
||||
@@ -16,7 +16,7 @@ Description: SAM Template for Hummingbird Lambda Example
|
||||
# See: https://docs.aws.amazon.com/lambda/latest/dg/invocation-async-retain-records.html#invocation-dlq
|
||||
# - Ensure that AWS Lambda function is configured inside a VPC when it needs to access private resources
|
||||
# See: https://docs.aws.amazon.com/lambda/latest/dg/configuration-vpc.html
|
||||
# Code Example: https://github.com/swift-server/swift-aws-lambda-runtime/tree/main/Examples/ServiceLifecycle%2BPostgres
|
||||
# Code Example: https://github.com/awslabs/swift-aws-lambda-runtime/tree/main/Examples/ServiceLifecycle%2BPostgres
|
||||
|
||||
Resources:
|
||||
# Lambda function
|
||||
|
||||
+1
-1
@@ -82,4 +82,4 @@ These are example applications for demonstration purposes. When deploying such i
|
||||
- Ensure that AWS Lambda function is configured for function-level concurrent execution limit ([concurrency documentation](https://docs.aws.amazon.com/lambda/latest/dg/lambda-concurrency.html), [configuration guide](https://docs.aws.amazon.com/lambda/latest/dg/configuration-concurrency.html))
|
||||
- Check encryption settings for Lambda environment variables ([documentation](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars-encryption.html))
|
||||
- Ensure that AWS Lambda function is configured for a Dead Letter Queue (DLQ) ([documentation](https://docs.aws.amazon.com/lambda/latest/dg/invocation-async-retain-records.html#invocation-dlq))
|
||||
- Ensure that AWS Lambda function is configured inside a VPC when it needs to access private resources ([documentation](https://docs.aws.amazon.com/lambda/latest/dg/configuration-vpc.html), [code example](https://github.com/swift-server/swift-aws-lambda-runtime/tree/main/Examples/ServiceLifecycle%2BPostgres))
|
||||
- Ensure that AWS Lambda function is configured inside a VPC when it needs to access private resources ([documentation](https://docs.aws.amazon.com/lambda/latest/dg/configuration-vpc.html), [code example](https://github.com/awslabs/swift-aws-lambda-runtime/tree/main/Examples/ServiceLifecycle%2BPostgres))
|
||||
@@ -17,7 +17,7 @@ let package = Package(
|
||||
.executable(name: "MyLambda", targets: ["MyLambda"])
|
||||
],
|
||||
dependencies: [
|
||||
.package(url: "https://github.com/swift-server/swift-aws-lambda-runtime.git", from: "2.0.0")
|
||||
.package(url: "https://github.com/awslabs/swift-aws-lambda-runtime.git", from: "2.0.0")
|
||||
],
|
||||
targets: [
|
||||
.executableTarget(
|
||||
@@ -42,7 +42,7 @@ if let localDepsPath = Context.environment["LAMBDA_USE_LOCAL_DEPS"],
|
||||
let indexToRemove = package.dependencies.firstIndex { dependency in
|
||||
if case .sourceControl(
|
||||
name: _,
|
||||
location: "https://github.com/swift-server/swift-aws-lambda-runtime.git",
|
||||
location: "https://github.com/awslabs/swift-aws-lambda-runtime.git",
|
||||
requirement: _
|
||||
) = dependency.kind {
|
||||
return true
|
||||
|
||||
@@ -8,8 +8,8 @@ let package = Package(
|
||||
name: "S3EventNotifier",
|
||||
platforms: [.macOS(.v15)],
|
||||
dependencies: [
|
||||
.package(url: "https://github.com/swift-server/swift-aws-lambda-runtime.git", from: "2.0.0"),
|
||||
.package(url: "https://github.com/swift-server/swift-aws-lambda-events", from: "1.0.0"),
|
||||
.package(url: "https://github.com/awslabs/swift-aws-lambda-runtime.git", from: "2.0.0"),
|
||||
.package(url: "https://github.com/awslabs/swift-aws-lambda-events", from: "1.0.0"),
|
||||
],
|
||||
targets: [
|
||||
.executableTarget(
|
||||
@@ -31,7 +31,7 @@ if let localDepsPath = Context.environment["LAMBDA_USE_LOCAL_DEPS"],
|
||||
let indexToRemove = package.dependencies.firstIndex { dependency in
|
||||
if case .sourceControl(
|
||||
name: _,
|
||||
location: "https://github.com/swift-server/swift-aws-lambda-runtime.git",
|
||||
location: "https://github.com/awslabs/swift-aws-lambda-runtime.git",
|
||||
requirement: _
|
||||
) = dependency.kind {
|
||||
return true
|
||||
|
||||
@@ -101,4 +101,4 @@ These are example applications for demonstration purposes. When deploying such i
|
||||
- Ensure that AWS Lambda function is configured for function-level concurrent execution limit ([concurrency documentation](https://docs.aws.amazon.com/lambda/latest/dg/lambda-concurrency.html), [configuration guide](https://docs.aws.amazon.com/lambda/latest/dg/configuration-concurrency.html))
|
||||
- Check encryption settings for Lambda environment variables ([documentation](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars-encryption.html))
|
||||
- Ensure that AWS Lambda function is configured for a Dead Letter Queue (DLQ) ([documentation](https://docs.aws.amazon.com/lambda/latest/dg/invocation-async-retain-records.html#invocation-dlq))
|
||||
- Ensure that AWS Lambda function is configured inside a VPC when it needs to access private resources ([documentation](https://docs.aws.amazon.com/lambda/latest/dg/configuration-vpc.html), [code example](https://github.com/swift-server/swift-aws-lambda-runtime/tree/main/Examples/ServiceLifecycle%2BPostgres))
|
||||
- Ensure that AWS Lambda function is configured inside a VPC when it needs to access private resources ([documentation](https://docs.aws.amazon.com/lambda/latest/dg/configuration-vpc.html), [code example](https://github.com/awslabs/swift-aws-lambda-runtime/tree/main/Examples/ServiceLifecycle%2BPostgres))
|
||||
@@ -13,8 +13,8 @@ let package = Package(
|
||||
],
|
||||
dependencies: [
|
||||
// during CI, the dependency on local version of swift-aws-lambda-runtime is added dynamically below
|
||||
.package(url: "https://github.com/swift-server/swift-aws-lambda-runtime.git", from: "2.0.0"),
|
||||
.package(url: "https://github.com/swift-server/swift-aws-lambda-events", from: "1.0.0"),
|
||||
.package(url: "https://github.com/awslabs/swift-aws-lambda-runtime.git", from: "2.0.0"),
|
||||
.package(url: "https://github.com/awslabs/swift-aws-lambda-events", from: "1.0.0"),
|
||||
.package(url: "https://github.com/awslabs/aws-sdk-swift", from: "1.0.0"),
|
||||
],
|
||||
targets: [
|
||||
@@ -38,7 +38,7 @@ if let localDepsPath = Context.environment["LAMBDA_USE_LOCAL_DEPS"],
|
||||
let indexToRemove = package.dependencies.firstIndex { dependency in
|
||||
if case .sourceControl(
|
||||
name: _,
|
||||
location: "https://github.com/swift-server/swift-aws-lambda-runtime.git",
|
||||
location: "https://github.com/awslabs/swift-aws-lambda-runtime.git",
|
||||
requirement: _
|
||||
) = dependency.kind {
|
||||
return true
|
||||
|
||||
@@ -14,7 +14,7 @@ The handler is `(event: APIGatewayV2Request, context: LambdaContext) -> APIGatew
|
||||
|
||||
The function must return a `APIGatewayV2Response`.
|
||||
|
||||
`APIGatewayV2Request` and `APIGatewayV2Response` are defined in the [Swift AWS Lambda Events](https://github.com/swift-server/swift-aws-lambda-events) library.
|
||||
`APIGatewayV2Request` and `APIGatewayV2Response` are defined in the [Swift AWS Lambda Events](https://github.com/awslabs/swift-aws-lambda-events) library.
|
||||
|
||||
The handler creates an S3 client and `ListBucketsInput` object. It passes the input object to the client and receives an output response.
|
||||
It then extracts the list of bucket names from the output and creates a `\n`-separated list of names, as a `String`
|
||||
@@ -96,4 +96,4 @@ These are example applications for demonstration purposes. When deploying such i
|
||||
- Ensure that AWS Lambda function is configured for function-level concurrent execution limit ([concurrency documentation](https://docs.aws.amazon.com/lambda/latest/dg/lambda-concurrency.html), [configuration guide](https://docs.aws.amazon.com/lambda/latest/dg/configuration-concurrency.html))
|
||||
- Check encryption settings for Lambda environment variables ([documentation](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars-encryption.html))
|
||||
- Ensure that AWS Lambda function is configured for a Dead Letter Queue (DLQ) ([documentation](https://docs.aws.amazon.com/lambda/latest/dg/invocation-async-retain-records.html#invocation-dlq))
|
||||
- Ensure that AWS Lambda function is configured inside a VPC when it needs to access private resources ([documentation](https://docs.aws.amazon.com/lambda/latest/dg/configuration-vpc.html), [code example](https://github.com/swift-server/swift-aws-lambda-runtime/tree/main/Examples/ServiceLifecycle%2BPostgres))
|
||||
- Ensure that AWS Lambda function is configured inside a VPC when it needs to access private resources ([documentation](https://docs.aws.amazon.com/lambda/latest/dg/configuration-vpc.html), [code example](https://github.com/awslabs/swift-aws-lambda-runtime/tree/main/Examples/ServiceLifecycle%2BPostgres))
|
||||
@@ -16,7 +16,7 @@ Description: SAM Template for AWS SDK Example
|
||||
# See: https://docs.aws.amazon.com/lambda/latest/dg/invocation-async-retain-records.html#invocation-dlq
|
||||
# - Ensure that AWS Lambda function is configured inside a VPC when it needs to access private resources
|
||||
# See: https://docs.aws.amazon.com/lambda/latest/dg/configuration-vpc.html
|
||||
# Code Example: https://github.com/swift-server/swift-aws-lambda-runtime/tree/main/Examples/ServiceLifecycle%2BPostgres
|
||||
# Code Example: https://github.com/awslabs/swift-aws-lambda-runtime/tree/main/Examples/ServiceLifecycle%2BPostgres
|
||||
|
||||
Resources:
|
||||
# Lambda function
|
||||
|
||||
@@ -15,8 +15,8 @@ let package = Package(
|
||||
.package(url: "https://github.com/soto-project/soto.git", from: "7.0.0"),
|
||||
|
||||
// during CI, the dependency on local version of swift-aws-lambda-runtime is added dynamically below
|
||||
.package(url: "https://github.com/swift-server/swift-aws-lambda-runtime.git", from: "2.0.0"),
|
||||
.package(url: "https://github.com/swift-server/swift-aws-lambda-events", from: "1.0.0"),
|
||||
.package(url: "https://github.com/awslabs/swift-aws-lambda-runtime.git", from: "2.0.0"),
|
||||
.package(url: "https://github.com/awslabs/swift-aws-lambda-events", from: "1.0.0"),
|
||||
],
|
||||
targets: [
|
||||
.executableTarget(
|
||||
@@ -39,7 +39,7 @@ if let localDepsPath = Context.environment["LAMBDA_USE_LOCAL_DEPS"],
|
||||
let indexToRemove = package.dependencies.firstIndex { dependency in
|
||||
if case .sourceControl(
|
||||
name: _,
|
||||
location: "https://github.com/swift-server/swift-aws-lambda-runtime.git",
|
||||
location: "https://github.com/awslabs/swift-aws-lambda-runtime.git",
|
||||
requirement: _
|
||||
) = dependency.kind {
|
||||
return true
|
||||
|
||||
@@ -14,7 +14,7 @@ The handler is `(event: APIGatewayV2Request, context: LambdaContext) -> APIGatew
|
||||
|
||||
The function must return a `APIGatewayV2Response`.
|
||||
|
||||
`APIGatewayV2Request` and `APIGatewayV2Response` are defined in the [Swift AWS Lambda Events](https://github.com/swift-server/swift-aws-lambda-events) library.
|
||||
`APIGatewayV2Request` and `APIGatewayV2Response` are defined in the [Swift AWS Lambda Events](https://github.com/awslabs/swift-aws-lambda-events) library.
|
||||
|
||||
The handler creates two clients : an AWS client that manages the communication with AWS API and and the S3 client that expose the S3 API. Then, the handler calls `listBuckets()` on the S3 client and receives an output response.
|
||||
Finally, the handler extracts the list of bucket names from the output to create a `\n`-separated list of names, as a `String`.
|
||||
@@ -96,4 +96,4 @@ These are example applications for demonstration purposes. When deploying such i
|
||||
- Ensure that AWS Lambda function is configured for function-level concurrent execution limit ([concurrency documentation](https://docs.aws.amazon.com/lambda/latest/dg/lambda-concurrency.html), [configuration guide](https://docs.aws.amazon.com/lambda/latest/dg/configuration-concurrency.html))
|
||||
- Check encryption settings for Lambda environment variables ([documentation](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars-encryption.html))
|
||||
- Ensure that AWS Lambda function is configured for a Dead Letter Queue (DLQ) ([documentation](https://docs.aws.amazon.com/lambda/latest/dg/invocation-async-retain-records.html#invocation-dlq))
|
||||
- Ensure that AWS Lambda function is configured inside a VPC when it needs to access private resources ([documentation](https://docs.aws.amazon.com/lambda/latest/dg/configuration-vpc.html), [code example](https://github.com/swift-server/swift-aws-lambda-runtime/tree/main/Examples/ServiceLifecycle%2BPostgres))
|
||||
- Ensure that AWS Lambda function is configured inside a VPC when it needs to access private resources ([documentation](https://docs.aws.amazon.com/lambda/latest/dg/configuration-vpc.html), [code example](https://github.com/awslabs/swift-aws-lambda-runtime/tree/main/Examples/ServiceLifecycle%2BPostgres))
|
||||
@@ -16,7 +16,7 @@ Description: SAM Template for AWS SDK Example
|
||||
# See: https://docs.aws.amazon.com/lambda/latest/dg/invocation-async-retain-records.html#invocation-dlq
|
||||
# - Ensure that AWS Lambda function is configured inside a VPC when it needs to access private resources
|
||||
# See: https://docs.aws.amazon.com/lambda/latest/dg/configuration-vpc.html
|
||||
# Code Example: https://github.com/swift-server/swift-aws-lambda-runtime/tree/main/Examples/ServiceLifecycle%2BPostgres
|
||||
# Code Example: https://github.com/awslabs/swift-aws-lambda-runtime/tree/main/Examples/ServiceLifecycle%2BPostgres
|
||||
|
||||
Resources:
|
||||
# Lambda function
|
||||
|
||||
@@ -13,8 +13,8 @@ let package = Package(
|
||||
],
|
||||
dependencies: [
|
||||
.package(url: "https://github.com/vapor/postgres-nio.git", from: "1.26.0"),
|
||||
.package(url: "https://github.com/swift-server/swift-aws-lambda-runtime.git", from: "2.0.0"),
|
||||
.package(url: "https://github.com/swift-server/swift-aws-lambda-events.git", from: "1.0.0"),
|
||||
.package(url: "https://github.com/awslabs/swift-aws-lambda-runtime.git", from: "2.0.0"),
|
||||
.package(url: "https://github.com/awslabs/swift-aws-lambda-events.git", from: "1.0.0"),
|
||||
.package(url: "https://github.com/swift-server/swift-service-lifecycle.git", from: "2.6.3"),
|
||||
],
|
||||
targets: [
|
||||
@@ -39,7 +39,7 @@ if let localDepsPath = Context.environment["LAMBDA_USE_LOCAL_DEPS"],
|
||||
let indexToRemove = package.dependencies.firstIndex { dependency in
|
||||
if case .sourceControl(
|
||||
name: _,
|
||||
location: "https://github.com/swift-server/swift-aws-lambda-runtime.git",
|
||||
location: "https://github.com/awslabs/swift-aws-lambda-runtime.git",
|
||||
requirement: _
|
||||
) = dependency.kind {
|
||||
return true
|
||||
|
||||
@@ -260,4 +260,4 @@ These are example applications for demonstration purposes. When deploying such i
|
||||
- Ensure that AWS Lambda function is configured for function-level concurrent execution limit ([concurrency documentation](https://docs.aws.amazon.com/lambda/latest/dg/lambda-concurrency.html), [configuration guide](https://docs.aws.amazon.com/lambda/latest/dg/configuration-concurrency.html))
|
||||
- Check encryption settings for Lambda environment variables ([documentation](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars-encryption.html))
|
||||
- Ensure that AWS Lambda function is configured for a Dead Letter Queue (DLQ) ([documentation](https://docs.aws.amazon.com/lambda/latest/dg/invocation-async-retain-records.html#invocation-dlq))
|
||||
- Ensure that AWS Lambda function is configured inside a VPC when it needs to access private resources ([documentation](https://docs.aws.amazon.com/lambda/latest/dg/configuration-vpc.html), [code example](https://github.com/swift-server/swift-aws-lambda-runtime/tree/main/Examples/ServiceLifecycle%2BPostgres))
|
||||
- Ensure that AWS Lambda function is configured inside a VPC when it needs to access private resources ([documentation](https://docs.aws.amazon.com/lambda/latest/dg/configuration-vpc.html), [code example](https://github.com/awslabs/swift-aws-lambda-runtime/tree/main/Examples/ServiceLifecycle%2BPostgres))
|
||||
@@ -10,8 +10,8 @@ let package = Package(
|
||||
platforms: [.macOS(.v15)],
|
||||
dependencies: [
|
||||
// during CI, the dependency on local version of swift-aws-lambda-runtime is added dynamically below
|
||||
.package(url: "https://github.com/swift-server/swift-aws-lambda-runtime.git", from: "2.0.0"),
|
||||
.package(url: "https://github.com/swift-server/swift-aws-lambda-events.git", from: "1.2.0"),
|
||||
.package(url: "https://github.com/awslabs/swift-aws-lambda-runtime.git", from: "2.0.0"),
|
||||
.package(url: "https://github.com/awslabs/swift-aws-lambda-events.git", from: "1.2.0"),
|
||||
],
|
||||
targets: [
|
||||
.executableTarget(
|
||||
@@ -40,7 +40,7 @@ if let localDepsPath = Context.environment["LAMBDA_USE_LOCAL_DEPS"],
|
||||
let indexToRemove = package.dependencies.firstIndex { dependency in
|
||||
if case .sourceControl(
|
||||
name: _,
|
||||
location: "https://github.com/swift-server/swift-aws-lambda-runtime.git",
|
||||
location: "https://github.com/awslabs/swift-aws-lambda-runtime.git",
|
||||
requirement: _
|
||||
) = dependency.kind {
|
||||
return true
|
||||
|
||||
@@ -297,4 +297,4 @@ These are example applications for demonstration purposes. When deploying such i
|
||||
- Ensure that AWS Lambda function is configured for function-level concurrent execution limit ([concurrency documentation](https://docs.aws.amazon.com/lambda/latest/dg/lambda-concurrency.html), [configuration guide](https://docs.aws.amazon.com/lambda/latest/dg/configuration-concurrency.html))
|
||||
- Check encryption settings for Lambda environment variables ([documentation](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars-encryption.html))
|
||||
- Ensure that AWS Lambda function is configured for a Dead Letter Queue (DLQ) ([documentation](https://docs.aws.amazon.com/lambda/latest/dg/invocation-async-retain-records.html#invocation-dlq))
|
||||
- Ensure that AWS Lambda function is configured inside a VPC when it needs to access private resources ([documentation](https://docs.aws.amazon.com/lambda/latest/dg/configuration-vpc.html), [code example](https://github.com/swift-server/swift-aws-lambda-runtime/tree/main/Examples/ServiceLifecycle%2BPostgres))
|
||||
- Ensure that AWS Lambda function is configured inside a VPC when it needs to access private resources ([documentation](https://docs.aws.amazon.com/lambda/latest/dg/configuration-vpc.html), [code example](https://github.com/awslabs/swift-aws-lambda-runtime/tree/main/Examples/ServiceLifecycle%2BPostgres))
|
||||
@@ -16,7 +16,7 @@ Description: SAM Template for StreamingfromEvent Example
|
||||
# See: https://docs.aws.amazon.com/lambda/latest/dg/invocation-async-retain-records.html#invocation-dlq
|
||||
# - Ensure that AWS Lambda function is configured inside a VPC when it needs to access private resources
|
||||
# See: https://docs.aws.amazon.com/lambda/latest/dg/configuration-vpc.html
|
||||
# Code Example: https://github.com/swift-server/swift-aws-lambda-runtime/tree/main/Examples/ServiceLifecycle%2BPostgres
|
||||
# Code Example: https://github.com/awslabs/swift-aws-lambda-runtime/tree/main/Examples/ServiceLifecycle%2BPostgres
|
||||
|
||||
Resources:
|
||||
# Lambda function
|
||||
|
||||
@@ -13,7 +13,7 @@ let package = Package(
|
||||
],
|
||||
dependencies: [
|
||||
// during CI, the dependency on local version of swift-aws-lambda-runtime is added dynamically below
|
||||
.package(url: "https://github.com/swift-server/swift-aws-lambda-runtime.git", from: "2.0.0")
|
||||
.package(url: "https://github.com/awslabs/swift-aws-lambda-runtime.git", from: "2.0.0")
|
||||
],
|
||||
targets: [
|
||||
.executableTarget(
|
||||
@@ -35,7 +35,7 @@ if let localDepsPath = Context.environment["LAMBDA_USE_LOCAL_DEPS"],
|
||||
let indexToRemove = package.dependencies.firstIndex { dependency in
|
||||
if case .sourceControl(
|
||||
name: _,
|
||||
location: "https://github.com/swift-server/swift-aws-lambda-runtime.git",
|
||||
location: "https://github.com/awslabs/swift-aws-lambda-runtime.git",
|
||||
requirement: _
|
||||
) = dependency.kind {
|
||||
return true
|
||||
|
||||
@@ -274,7 +274,7 @@ sam delete
|
||||
The content of the input `ByteBuffer` depends on how you invoke the function:
|
||||
|
||||
- when you use [`InvokeWithResponseStream` API](https://docs.aws.amazon.com/lambda/latest/api/API_InvokeWithResponseStream.html) to invoke the function, the function incoming payload is what you pass to the API. You can decode the `ByteBuffer` with a [`JSONDecoder.decode()`](https://developer.apple.com/documentation/foundation/jsondecoder) function call.
|
||||
- when you invoke the function through a [Lambda function URL](https://docs.aws.amazon.com/lambda/latest/dg/urls-configuration.html), the incoming `ByteBuffer` contains a payload that gives developer access to the underlying HTTP call. The payload contains information about the HTTP verb used, the headers received, the authentication method and so on. The [AWS documentation contains the details](https://docs.aws.amazon.com/lambda/latest/dg/urls-invocation.html) of the payload. The [Swift Lambda Event library](https://github.com/swift-server/swift-aws-lambda-events) contains a [`FunctionURL` type](https://github.com/swift-server/swift-aws-lambda-events/blob/main/Sources/AWSLambdaEvents/FunctionURL.swift) ready to use in your projects.
|
||||
- when you invoke the function through a [Lambda function URL](https://docs.aws.amazon.com/lambda/latest/dg/urls-configuration.html), the incoming `ByteBuffer` contains a payload that gives developer access to the underlying HTTP call. The payload contains information about the HTTP verb used, the headers received, the authentication method and so on. The [AWS documentation contains the details](https://docs.aws.amazon.com/lambda/latest/dg/urls-invocation.html) of the payload. The [Swift Lambda Event library](https://github.com/awslabs/swift-aws-lambda-events) contains a [`FunctionURL` type](https://github.com/awslabs/swift-aws-lambda-events/blob/main/Sources/AWSLambdaEvents/FunctionURL.swift) ready to use in your projects.
|
||||
|
||||
Here is an example of Lambda function URL payload:
|
||||
|
||||
@@ -337,4 +337,4 @@ These are example applications for demonstration purposes. When deploying such i
|
||||
- Ensure that AWS Lambda function is configured for function-level concurrent execution limit ([concurrency documentation](https://docs.aws.amazon.com/lambda/latest/dg/lambda-concurrency.html), [configuration guide](https://docs.aws.amazon.com/lambda/latest/dg/configuration-concurrency.html))
|
||||
- Check encryption settings for Lambda environment variables ([documentation](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars-encryption.html))
|
||||
- Ensure that AWS Lambda function is configured for a Dead Letter Queue (DLQ) ([documentation](https://docs.aws.amazon.com/lambda/latest/dg/invocation-async-retain-records.html#invocation-dlq))
|
||||
- Ensure that AWS Lambda function is configured inside a VPC when it needs to access private resources ([documentation](https://docs.aws.amazon.com/lambda/latest/dg/configuration-vpc.html), [code example](https://github.com/swift-server/swift-aws-lambda-runtime/tree/main/Examples/ServiceLifecycle%2BPostgres))
|
||||
- Ensure that AWS Lambda function is configured inside a VPC when it needs to access private resources ([documentation](https://docs.aws.amazon.com/lambda/latest/dg/configuration-vpc.html), [code example](https://github.com/awslabs/swift-aws-lambda-runtime/tree/main/Examples/ServiceLifecycle%2BPostgres))
|
||||
@@ -16,7 +16,7 @@ Description: SAM Template for Streaming Example
|
||||
# See: https://docs.aws.amazon.com/lambda/latest/dg/invocation-async-retain-records.html#invocation-dlq
|
||||
# - Ensure that AWS Lambda function is configured inside a VPC when it needs to access private resources
|
||||
# See: https://docs.aws.amazon.com/lambda/latest/dg/configuration-vpc.html
|
||||
# Code Example: https://github.com/swift-server/swift-aws-lambda-runtime/tree/main/Examples/ServiceLifecycle%2BPostgres
|
||||
# Code Example: https://github.com/awslabs/swift-aws-lambda-runtime/tree/main/Examples/ServiceLifecycle%2BPostgres
|
||||
|
||||
Resources:
|
||||
# Lambda function
|
||||
|
||||
@@ -13,8 +13,8 @@ let package = Package(
|
||||
],
|
||||
dependencies: [
|
||||
// during CI, the dependency on local version of swift-aws-lambda-runtime is added dynamically below
|
||||
.package(url: "https://github.com/swift-server/swift-aws-lambda-runtime.git", from: "2.0.0"),
|
||||
.package(url: "https://github.com/swift-server/swift-aws-lambda-events.git", from: "1.0.0"),
|
||||
.package(url: "https://github.com/awslabs/swift-aws-lambda-runtime.git", from: "2.0.0"),
|
||||
.package(url: "https://github.com/awslabs/swift-aws-lambda-events.git", from: "1.0.0"),
|
||||
],
|
||||
targets: [
|
||||
.executableTarget(
|
||||
@@ -45,7 +45,7 @@ if let localDepsPath = Context.environment["LAMBDA_USE_LOCAL_DEPS"],
|
||||
let indexToRemove = package.dependencies.firstIndex { dependency in
|
||||
if case .sourceControl(
|
||||
name: _,
|
||||
location: "https://github.com/swift-server/swift-aws-lambda-runtime.git",
|
||||
location: "https://github.com/awslabs/swift-aws-lambda-runtime.git",
|
||||
requirement: _
|
||||
) = dependency.kind {
|
||||
return true
|
||||
|
||||
@@ -178,4 +178,4 @@ These are example applications for demonstration purposes. When deploying such i
|
||||
- Ensure that AWS Lambda function is configured for function-level concurrent execution limit ([concurrency documentation](https://docs.aws.amazon.com/lambda/latest/dg/lambda-concurrency.html), [configuration guide](https://docs.aws.amazon.com/lambda/latest/dg/configuration-concurrency.html))
|
||||
- Check encryption settings for Lambda environment variables ([documentation](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars-encryption.html))
|
||||
- Ensure that AWS Lambda function is configured for a Dead Letter Queue (DLQ) ([documentation](https://docs.aws.amazon.com/lambda/latest/dg/invocation-async-retain-records.html#invocation-dlq))
|
||||
- Ensure that AWS Lambda function is configured inside a VPC when it needs to access private resources ([documentation](https://docs.aws.amazon.com/lambda/latest/dg/configuration-vpc.html), [code example](https://github.com/swift-server/swift-aws-lambda-runtime/tree/main/Examples/ServiceLifecycle%2BPostgres))
|
||||
- Ensure that AWS Lambda function is configured inside a VPC when it needs to access private resources ([documentation](https://docs.aws.amazon.com/lambda/latest/dg/configuration-vpc.html), [code example](https://github.com/awslabs/swift-aws-lambda-runtime/tree/main/Examples/ServiceLifecycle%2BPostgres))
|
||||
@@ -16,7 +16,7 @@ Description: SAM Template for APIGateway Lambda Example
|
||||
# See: https://docs.aws.amazon.com/lambda/latest/dg/invocation-async-retain-records.html#invocation-dlq
|
||||
# - Ensure that AWS Lambda function is configured inside a VPC when it needs to access private resources
|
||||
# See: https://docs.aws.amazon.com/lambda/latest/dg/configuration-vpc.html
|
||||
# Code Example: https://github.com/swift-server/swift-aws-lambda-runtime/tree/main/Examples/ServiceLifecycle%2BPostgres
|
||||
# Code Example: https://github.com/awslabs/swift-aws-lambda-runtime/tree/main/Examples/ServiceLifecycle%2BPostgres
|
||||
|
||||
Resources:
|
||||
# Lambda function
|
||||
|
||||
@@ -9,7 +9,7 @@ let package = Package(
|
||||
name: "Palindrome",
|
||||
platforms: [.macOS(.v15)],
|
||||
dependencies: [
|
||||
.package(url: "https://github.com/swift-server/swift-aws-lambda-runtime.git", from: "2.0.0")
|
||||
.package(url: "https://github.com/awslabs/swift-aws-lambda-runtime.git", from: "2.0.0")
|
||||
],
|
||||
targets: [
|
||||
// Targets are the basic building blocks of a package, defining a module or a test suite.
|
||||
@@ -32,7 +32,7 @@ if let localDepsPath = Context.environment["LAMBDA_USE_LOCAL_DEPS"],
|
||||
let indexToRemove = package.dependencies.firstIndex { dependency in
|
||||
if case .sourceControl(
|
||||
name: _,
|
||||
location: "https://github.com/swift-server/swift-aws-lambda-runtime.git",
|
||||
location: "https://github.com/awslabs/swift-aws-lambda-runtime.git",
|
||||
requirement: _
|
||||
) = dependency.kind {
|
||||
return true
|
||||
|
||||
@@ -79,8 +79,8 @@ create_swift_project() {
|
||||
|
||||
echo "📦 Add the AWS Lambda Swift runtime to your project"
|
||||
# The following commands are commented out until the `lambad-init` plugin will be release
|
||||
# swift package add-dependency https://github.com/swift-server/swift-aws-lambda-runtime.git --from 2.0.0
|
||||
# swift package add-dependency https://github.com/swift-server/swift-aws-lambda-events.git --from 1.0.0
|
||||
# swift package add-dependency https://github.com/awslabs/swift-aws-lambda-runtime.git --from 2.0.0
|
||||
# swift package add-dependency https://github.com/awslabs/swift-aws-lambda-events.git --from 1.0.0
|
||||
# swift package add-target-dependency AWSLambdaRuntime MyLambda --package swift-aws-lambda-runtime
|
||||
# swift package add-target-dependency AWSLambdaEvents MyLambda --package swift-aws-lambda-events
|
||||
cat <<EOF > Package.swift
|
||||
@@ -95,7 +95,7 @@ let package = Package(
|
||||
.executable(name: "MyLambda", targets: ["MyLambda"])
|
||||
],
|
||||
dependencies: [
|
||||
.package(url: "https://github.com/swift-server/swift-aws-lambda-runtime.git", from: "2.0.0")
|
||||
.package(url: "https://github.com/awslabs/swift-aws-lambda-runtime.git", from: "2.0.0")
|
||||
],
|
||||
targets: [
|
||||
.executableTarget(
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
|
||||
Please visit the SwiftAWSLambdaRuntime web site for more information:
|
||||
|
||||
* https://github.com/swift-server/swift-aws-lambda-runtime
|
||||
* https://github.com/awslabs/swift-aws-lambda-runtime
|
||||
|
||||
Copyright 2017-2021 The SwiftAWSLambdaRuntime Project
|
||||
|
||||
|
||||
@@ -260,7 +260,7 @@ struct AWSLambdaPackager: CommandPlugin {
|
||||
// On Linux, when the build has been done with Docker,
|
||||
// the source file are owned by root
|
||||
// this causes a permission error **after** the files have been copied
|
||||
// see https://github.com/swift-server/swift-aws-lambda-runtime/issues/449
|
||||
// see https://github.com/awslabs/swift-aws-lambda-runtime/issues/449
|
||||
// see https://forums.swift.org/t/filemanager-copyitem-on-linux-fails-after-copying-the-files/77282
|
||||
|
||||
// because this error happens after the files have been copied, we can ignore it
|
||||
|
||||
@@ -64,7 +64,7 @@ The plugin cannot be invoked without the required dependency on `swift-aws-lambd
|
||||
swift package init --type executable --name MyLambda
|
||||
|
||||
# Step 2: Add the Swift AWS Lambda Runtime dependency
|
||||
swift package add-dependency https://github.com/swift-server/swift-aws-lambda-runtime.git --branch main
|
||||
swift package add-dependency https://github.com/awslabs/swift-aws-lambda-runtime.git --branch main
|
||||
swift package add-target-dependency AWSLambdaRuntime MyLambda --package swift-aws-lambda-runtime
|
||||
|
||||
# Step 3: Call the lambda-init plugin
|
||||
|
||||
@@ -58,7 +58,7 @@ Here is the content of this guide:
|
||||
|
||||
3. A Swift Lambda function to deploy.
|
||||
|
||||
You need a Swift Lambda function to deploy. If you don't have one yet, you can use one of the examples in the [Examples](https://github.com/swift-server/swift-aws-lambda-runtime/tree/main/Examples) directory.
|
||||
You need a Swift Lambda function to deploy. If you don't have one yet, you can use one of the examples in the [Examples](https://github.com/awslabs/swift-aws-lambda-runtime/tree/main/Examples) directory.
|
||||
|
||||
Compile and package the function using the following command
|
||||
|
||||
@@ -170,7 +170,7 @@ Select the `HelloWorld-role-xxxx` role and select **Delete**. Confirm the deleti
|
||||
|
||||
You can deploy your Lambda function using the AWS Command Line Interface (CLI). The CLI is a unified tool to manage your AWS services from the command line and automate your operations through scripts. The CLI is available for Windows, macOS, and Linux. Follow the [installation](https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html) and [configuration](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-quickstart.html) instructions in the AWS CLI User Guide.
|
||||
|
||||
In this example, we're building the HelloWorld example from the [Examples](https://github.com/swift-server/swift-aws-lambda-runtime/tree/main/Examples) directory.
|
||||
In this example, we're building the HelloWorld example from the [Examples](https://github.com/awslabs/swift-aws-lambda-runtime/tree/main/Examples) directory.
|
||||
|
||||
#### Create the function
|
||||
|
||||
@@ -328,7 +328,7 @@ Outputs:
|
||||
EOF
|
||||
```
|
||||
|
||||
In this example, the Lambda function must accept an APIGateway v2 JSON payload as input parameter and return a valid APIGAteway v2 JSON response. See the example code in the [APIGateway example README file](https://github.com/swift-server/swift-aws-lambda-runtime/blob/main/Examples/APIGateway/README.md).
|
||||
In this example, the Lambda function must accept an APIGateway v2 JSON payload as input parameter and return a valid APIGAteway v2 JSON response. See the example code in the [APIGateway example README file](https://github.com/awslabs/swift-aws-lambda-runtime/blob/main/Examples/APIGateway/README.md).
|
||||
|
||||
To deploy the function with SAM, use the `sam deploy` command. The very first time you deploy a function, you should use the `--guided` flag to configure the deployment. The command will ask you a series of questions to configure the deployment.
|
||||
|
||||
@@ -453,7 +453,7 @@ To use the CDK, you need to [install the CDK CLI](https://docs.aws.amazon.com/cd
|
||||
|
||||
Use the CDK when you want to define your infrastructure in code and manage the deployment of your Lambda function and other AWS services.
|
||||
|
||||
This example deploys the [APIGateway]((https://github.com/swift-server/swift-aws-lambda-runtime/blob/main/Examples/APIGateway/) example code. It comprises a Lambda function that implements a REST API and an API Gateway to expose the function over HTTPS.
|
||||
This example deploys the [APIGateway]((https://github.com/awslabs/swift-aws-lambda-runtime/blob/main/Examples/APIGateway/) example code. It comprises a Lambda function that implements a REST API and an API Gateway to expose the function over HTTPS.
|
||||
|
||||
#### Create a CDK project
|
||||
|
||||
@@ -636,4 +636,4 @@ These are example applications for demonstration purposes. When deploying such i
|
||||
- Ensure that AWS Lambda function is configured for function-level concurrent execution limit ([concurrency documentation](https://docs.aws.amazon.com/lambda/latest/dg/lambda-concurrency.html), [configuration guide](https://docs.aws.amazon.com/lambda/latest/dg/configuration-concurrency.html))
|
||||
- Check encryption settings for Lambda environment variables ([documentation](https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars-encryption.html))
|
||||
- Ensure that AWS Lambda function is configured for a Dead Letter Queue (DLQ) ([documentation](https://docs.aws.amazon.com/lambda/latest/dg/invocation-async-retain-records.html#invocation-dlq))
|
||||
- Ensure that AWS Lambda function is configured inside a VPC when it needs to access private resources ([documentation](https://docs.aws.amazon.com/lambda/latest/dg/configuration-vpc.html), [code example](https://github.com/swift-server/swift-aws-lambda-runtime/tree/main/Examples/ServiceLifecycle%2BPostgres))
|
||||
- Ensure that AWS Lambda function is configured inside a VPC when it needs to access private resources ([documentation](https://docs.aws.amazon.com/lambda/latest/dg/configuration-vpc.html), [code example](https://github.com/awslabs/swift-aws-lambda-runtime/tree/main/Examples/ServiceLifecycle%2BPostgres))
|
||||
@@ -44,7 +44,7 @@ A Lambda function can currently be implemented through conformance to the variou
|
||||
This allows users to annotate their `LambdaHandler` conforming object with `@main`. The `static func main()` calls the
|
||||
internal `Lambda.run()` function, which starts the Lambda function. Since the `Lambda.run()` method is internal, users
|
||||
cannot override the default implementation. This has proven challenging for users who want to
|
||||
[set up global properties before the Lambda starts-up](https://github.com/swift-server/swift-aws-lambda-runtime/issues/265).
|
||||
[set up global properties before the Lambda starts-up](https://github.com/awslabs/swift-aws-lambda-runtime/issues/265).
|
||||
Setting up global properties is required to customize the Swift Logging, Metric and Tracing backend.
|
||||
|
||||
##### Non-trivial transition from SimpleLambdaHandler to LambdaHandler
|
||||
|
||||
@@ -9,6 +9,6 @@ let package = Package(
|
||||
.macOS(.v15)
|
||||
],
|
||||
dependencies: [
|
||||
.package(url: "https://github.com/swift-server/swift-aws-lambda-runtime.git", from: "2.0.0")
|
||||
.package(url: "https://github.com/awslabs/swift-aws-lambda-runtime.git", from: "2.0.0")
|
||||
]
|
||||
)
|
||||
|
||||
@@ -12,6 +12,6 @@ let package = Package(
|
||||
.executable(name: "PalindromeLambda", targets: ["PalindromeLambda"])
|
||||
],
|
||||
dependencies: [
|
||||
.package(url: "https://github.com/swift-server/swift-aws-lambda-runtime.git", from: "2.0.0")
|
||||
.package(url: "https://github.com/awslabs/swift-aws-lambda-runtime.git", from: "2.0.0")
|
||||
]
|
||||
)
|
||||
|
||||
@@ -12,7 +12,7 @@ let package = Package(
|
||||
.executable(name: "PalindromeLambda", targets: ["PalindromeLambda"])
|
||||
],
|
||||
dependencies: [
|
||||
.package(url: "https://github.com/swift-server/swift-aws-lambda-runtime.git", from: "2.0.0")
|
||||
.package(url: "https://github.com/awslabs/swift-aws-lambda-runtime.git", from: "2.0.0")
|
||||
],
|
||||
targets: [
|
||||
.executableTarget(
|
||||
|
||||
@@ -37,7 +37,7 @@ let package = Package(
|
||||
.executable(name: "MyFirstLambdaFunction", targets: ["MyFirstLambdaFunction"]),
|
||||
],
|
||||
dependencies: [
|
||||
.package(url: "https://github.com/swift-server/swift-aws-lambda-runtime.git", from: "2.0.0"),
|
||||
.package(url: "https://github.com/awslabs/swift-aws-lambda-runtime.git", from: "2.0.0"),
|
||||
],
|
||||
targets: [
|
||||
.executableTarget(
|
||||
@@ -55,7 +55,7 @@ let package = Package(
|
||||
|
||||
Create an instance of `LambdaRuntime` and pass a function as a closure. The function has this signature: `(_: Event, context: LambdaContext) async throws -> Output` (as defined in the `LambdaHandler` protocol). `Event` must be `Decodable`. `Output` must be `Encodable`.
|
||||
|
||||
If your Lambda function is invoked by another AWS service, use the `AWSLambdaEvent` library at [https://github.com/swift-server/swift-aws-lambda-events](https://github.com/swift-server/swift-aws-lambda-events) to represent the input event.
|
||||
If your Lambda function is invoked by another AWS service, use the `AWSLambdaEvent` library at [https://github.com/awslabs/swift-aws-lambda-events](https://github.com/awslabs/swift-aws-lambda-events) to represent the input event.
|
||||
|
||||
Finally, call `runtime.run()` to start the event loop.
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ You will learn three things:
|
||||
|
||||
It's a beginners' tutorial. The business logic of the function is very simple, it computes the square of a number passed as input parameter. This simplicity allows you to focus on the project setup and the deployment. You will deploy your code using the AWS Management Console. It is the easiest way to get started with AWS Lambda.
|
||||
|
||||
If you have any questions or recommendations, please [leave your feedback on GitHub](https://github.com/swift-server/swift-aws-lambda-runtime/issues) so that you can get your question answered and this tutorial can be improved.
|
||||
If you have any questions or recommendations, please [leave your feedback on GitHub](https://github.com/awslabs/swift-aws-lambda-runtime/issues) so that you can get your question answered and this tutorial can be improved.
|
||||
|
||||
*The following instructions were recorded on January 2025 and the AWS Management Console may have changed since then. Feel free to raise an issue if you spot differences with our screenshots*
|
||||
}
|
||||
@@ -69,7 +69,7 @@
|
||||
@Step {
|
||||
Add the `dependencies` section.
|
||||
|
||||
It defines what external libraries your code depends on. To run code within AWS Lambda you'll need a runtime that handles the communication with the [Lambda Runtime Interface](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-api.html). This is what the `AWSLambdaRuntime` is for. You import it by specifying its GitHub url: `https://github.com/swift-server/swift-aws-lambda-runtime.git`.
|
||||
It defines what external libraries your code depends on. To run code within AWS Lambda you'll need a runtime that handles the communication with the [Lambda Runtime Interface](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-api.html). This is what the `AWSLambdaRuntime` is for. You import it by specifying its GitHub url: `https://github.com/awslabs/swift-aws-lambda-runtime.git`.
|
||||
|
||||
@Code(name: "Package.swift", file: 03-02-03-package.swift)
|
||||
}
|
||||
@@ -104,7 +104,7 @@
|
||||
|
||||
Input parameters must conform to the `Decodable` protocol. This ensures that your Lambda function accepts any JSON input.
|
||||
|
||||
> When your function is triggered by another AWS service, we modeled most of the input and output data format for you. You can add the dependency on [https://github.com/swift-server/swift-aws-lambda-events](https://github.com/swift-server/swift-aws-lambda-events) and import `AWSLambdaEvents` in your code.
|
||||
> When your function is triggered by another AWS service, we modeled most of the input and output data format for you. You can add the dependency on [https://github.com/awslabs/swift-aws-lambda-events](https://github.com/awslabs/swift-aws-lambda-events) and import `AWSLambdaEvents` in your code.
|
||||
|
||||
@Code(name: "main.swift", file: 03-03-01-main.swift)
|
||||
}
|
||||
@@ -114,7 +114,7 @@
|
||||
|
||||
Output parameters must conform to the `Encodable` protocol. This ensures that your Lambda function returns a valid JSON output. Your function might also return `Void` if it does not return any value.
|
||||
|
||||
> You can also write function that stream a response back to the caller. This is useful when you have a large amount of data to return. See the [Lambda Streaming example](https://github.com/swift-server/swift-aws-lambda-runtime/tree/main/Examples/Streaming) for more information.
|
||||
> You can also write function that stream a response back to the caller. This is useful when you have a large amount of data to return. See the [Lambda Streaming example](https://github.com/awslabs/swift-aws-lambda-runtime/tree/main/Examples/Streaming) for more information.
|
||||
|
||||
@Code(name: "main.swift", file: 03-03-02-main.swift)
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
|
||||
You can read [the Swift AWS Lambda Runtime documentation](https://swiftpackageindex.com/swift-server/swift-aws-lambda-runtime/2.0.0/documentation/awslambdaruntime) on the Swift Package Index.
|
||||
You can read [the Swift AWS Lambda Runtime documentation](https://swiftpackageindex.com/awslabs/swift-aws-lambda-runtime/2.3.0/documentation/awslambdaruntime) on the Swift Package Index.
|
||||
|
||||
This guide contains the following sections:
|
||||
|
||||
@@ -37,9 +37,9 @@ Swift AWS Lambda Runtime was designed to make building Lambda functions in Swift
|
||||
|
||||
## Getting started
|
||||
|
||||
To get started, read [the Swift AWS Lambda runtime tutorial](https://swiftpackageindex.com/swift-server/swift-aws-lambda-runtime/main/tutorials/table-of-content). It provides developers with detailed step-by-step instructions to develop, build, and deploy a Lambda function.
|
||||
To get started, read [the Swift AWS Lambda runtime tutorial](https://swiftpackageindex.com/awslabs/swift-aws-lambda-runtime/2.3.0/tutorials/table-of-content). It provides developers with detailed step-by-step instructions to develop, build, and deploy a Lambda function.
|
||||
|
||||
We also wrote a comprehensive [deployment guide](https://swiftpackageindex.com/swift-server/swift-aws-lambda-runtime/main/documentation/awslambdaruntime/deployment).
|
||||
We also wrote a comprehensive [deployment guide](https://swiftpackageindex.com/awslabs/swift-aws-lambda-runtime/2.3.0/documentation/awslambdaruntime/deployment).
|
||||
|
||||
Or, if you're impatient to start with runtime v2, try these six steps:
|
||||
|
||||
@@ -66,7 +66,7 @@ swift package init --type executable
|
||||
2.1 Add the Swift AWS Lambda Runtime as a dependency
|
||||
|
||||
```bash
|
||||
swift package add-dependency https://github.com/swift-server/swift-aws-lambda-runtime.git --from 2.0.0
|
||||
swift package add-dependency https://github.com/awslabs/swift-aws-lambda-runtime.git --from 2.0.0
|
||||
swift package add-target-dependency AWSLambdaRuntime MyLambda --package swift-aws-lambda-runtime --from 1.0.0
|
||||
```
|
||||
|
||||
@@ -87,7 +87,7 @@ swift package init --type executable
|
||||
name: "MyLambda",
|
||||
platforms: [.macOS(.v15)],
|
||||
dependencies: [
|
||||
.package(url: "https://github.com/swift-server/swift-aws-lambda-runtime.git", from: "2.0.0"),
|
||||
.package(url: "https://github.com/awslabs/swift-aws-lambda-runtime.git", from: "2.0.0"),
|
||||
],
|
||||
targets: [
|
||||
.executableTarget(
|
||||
@@ -159,7 +159,7 @@ Be sure to replace <YOUR_ACCOUNT_ID> with your actual AWS account ID (for exampl
|
||||
>
|
||||
> You can create this role in two ways:
|
||||
> 1. Using AWS Console
|
||||
> 2. Running the commands in the `create_lambda_execution_role()` function in [`Examples/_MyFirstFunction/create_iam_role.sh`](https://github.com/swift-server/swift-aws-lambda-runtime/blob/8dff649920ab0c66bb039d15ae48d9d5764db71a/Examples/_MyFirstFunction/create_and_deploy_function.sh#L40C1-L40C31)
|
||||
> 2. Running the commands in the `create_lambda_execution_role()` function in [`Examples/_MyFirstFunction/create_iam_role.sh`](https://github.com/awslabs/swift-aws-lambda-runtime/blob/8dff649920ab0c66bb039d15ae48d9d5764db71a/Examples/_MyFirstFunction/create_and_deploy_function.sh#L40C1-L40C31)
|
||||
|
||||
6. Invoke your Lambda function
|
||||
|
||||
@@ -378,7 +378,7 @@ try await runtime.run()
|
||||
|
||||
### Integration with Swift Service LifeCycle
|
||||
|
||||
Support for [Swift Service Lifecycle](https://github.com/swift-server/swift-service-lifecycle) is currently being implemented. You can follow https://github.com/swift-server/swift-aws-lambda-runtime/issues/374 for more details and teh current status. Your contributions are welcome.
|
||||
Support for [Swift Service Lifecycle](https://github.com/swift-server/swift-service-lifecycle) is currently being implemented. You can follow https://github.com/awslabs/swift-aws-lambda-runtime/issues/374 for more details and the current status. Your contributions are welcome.
|
||||
|
||||
### Use Lambda Background Tasks
|
||||
|
||||
@@ -484,7 +484,7 @@ LOCAL_LAMBDA_PORT=8080 LOCAL_LAMBDA_INVOCATION_ENDPOINT=/2015-03-31/functions/fu
|
||||
|
||||
## Deploying your Swift Lambda functions
|
||||
|
||||
There is a full deployment guide available in [the documentation](https://swiftpackageindex.com/swift-server/swift-aws-lambda-runtime/main/documentation/awslambdaruntime/deployment).
|
||||
There is a full deployment guide available in [the documentation](https://swiftpackageindex.com/awslabs/swift-aws-lambda-runtime/2.3.0/documentation/awslambdaruntime/deployment).
|
||||
|
||||
There are multiple ways to deploy your Swift code to AWS Lambda. The very first time, you'll probably use the AWS Console to create a new Lambda function and upload your code as a zip file. However, as you iterate on your code, you'll want to automate the deployment process.
|
||||
|
||||
@@ -522,7 +522,7 @@ Value https://a5q74es3k2.execute-api.us-east-1.amazonaws.com
|
||||
-----------------------------------------------------------------------------------------------------------------------------
|
||||
```
|
||||
|
||||
Please refer to the full deployment guide available in [the documentation](https://swiftpackageindex.com/swift-server/swift-aws-lambda-runtime/main/documentation/awslambdaruntime) for more details.
|
||||
Please refer to [the full deployment guide available in the documentation](https://swiftpackageindex.com/awslabs/swift-aws-lambda-runtime/2.3.0/documentation/awslambdaruntime/deployment) for more details.
|
||||
|
||||
## Swift AWS Lambda Runtime - Design Principles
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
export PATH=/home/ubuntu/swift-6.0.3-RELEASE-ubuntu24.04-aarch64/usr/bin:"${PATH}"
|
||||
|
||||
# clone a project
|
||||
git clone https://github.com/swift-server/swift-aws-lambda-runtime.git
|
||||
git clone https://github.com/awslabs/swift-aws-lambda-runtime.git
|
||||
|
||||
# be sure Swift is install.
|
||||
# Youc an install swift with the following command: ./scripts/ubuntu-install-swift.sh
|
||||
|
||||
Reference in New Issue
Block a user