Skip to content

Commit a844d9e

Browse files
committed
Do some code cleaning
1 parent 3e8c07d commit a844d9e

File tree

10 files changed

+61
-9
lines changed

10 files changed

+61
-9
lines changed

Examples/Deployment/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ The SAM template will provide an output labelled `LambdaApiGatewayEndpoint` whic
8787

8888
```
8989
curl <<LambdaApiGatewayEndpoint>>
90-
```
90+
```
9191

9292
***Warning:*** This SAM template is only intended as a sample and creates a publicly accessible HTTP endpoint.
9393

@@ -162,7 +162,7 @@ For example:
162162

163163
```
164164
curl https://r39lvhfng3.execute-api.us-east-1.amazonaws.com/api
165-
```
165+
```
166166

167167
***Warning:*** This Serverless template is only intended as a sample and creates a publicly accessible HTTP endpoint.
168168

Examples/Deployment/scripts/serverless/APIGateway-template.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ provider:
1616
- logs:CreateLogGroup
1717
- logs:CreateLogStream
1818
- logs:PutLogEvents
19-
Resource: "*"
19+
Resource: "*"
2020

2121
functions:
2222
httpGet:

Examples/Deployment/scripts/serverless/Benchmark-template.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ provider:
1212
- logs:CreateLogGroup
1313
- logs:CreateLogStream
1414
- logs:PutLogEvents
15-
Resource: "*"
15+
Resource: "*"
1616

1717
functions:
1818
benchmarkFunction:

Examples/Deployment/scripts/serverless/HelloWorld-template.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ provider:
1212
- logs:CreateLogGroup
1313
- logs:CreateLogStream
1414
- logs:PutLogEvents
15-
Resource: "*"
15+
Resource: "*"
1616

1717
functions:
1818
hello:
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
AWSTemplateFormatVersion : '2010-09-09'
2+
Transform: AWS::Serverless-2016-10-31
3+
Description: A sample SAM template for deploying Lambda functions.
4+
5+
Resources:
6+
# ErrorHandling Function
7+
errorHandlingFunction:
8+
Type: AWS::Serverless::Function
9+
Properties:
10+
Handler: Provided
11+
Runtime: provided
12+
CodeUri: ../../.build/lambda/ErrorHandling/lambda.zip
13+
# Instructs new versions to be published to an alias named "live".
14+
AutoPublishAlias: live
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
service: currency-swift-aws
2+
3+
package:
4+
artifact: .build/lambda/CurrencyExchange/lambda.zip
5+
6+
provider:
7+
name: aws
8+
runtime: provided
9+
iamRoleStatements:
10+
- Effect: Allow
11+
Action:
12+
- logs:CreateLogGroup
13+
- logs:CreateLogStream
14+
- logs:PutLogEvents
15+
Resource: "*"
16+
17+
functions:
18+
currencyExchangeFunction:
19+
handler: CurrencyExchange
20+
memorySize: 128
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
service: errorhandling-swift-aws
2+
3+
package:
4+
artifact: .build/lambda/ErrorHandling/lambda.zip
5+
6+
provider:
7+
name: aws
8+
runtime: provided
9+
iamRoleStatements:
10+
- Effect: Allow
11+
Action:
12+
- logs:CreateLogGroup
13+
- logs:CreateLogStream
14+
- logs:PutLogEvents
15+
Resource: "*"
16+
17+
functions:
18+
errorHandlingFunction:
19+
handler: ErrorHandling
20+
memorySize: 128

Sources/AWSLambdaRuntimeCore/Utils.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
//===----------------------------------------------------------------------===//
1414

1515
import Dispatch
16-
import NIOPosix
1716

1817
internal enum Consts {
1918
static let apiPrefix = "/2018-06-01"

Sources/AWSLambdaTesting/Lambda+Testing.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535

3636
#if compiler(>=5.5) && canImport(_Concurrency)
3737
import AWSLambdaRuntime
38-
import AWSLambdaRuntimeCore
3938
import Dispatch
4039
import Logging
4140
import NIOCore

readme.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ First, add a dependency on the event packages:
144144

145145
Beyond the small cognitive complexity of using the `EventLoopFuture` based APIs, note these APIs should be used with extra care. An `EventLoopLambdaHandler` will execute the user code on the same `EventLoop` (thread) as the library, making processing faster but requiring the user code to never call blocking APIs as it might prevent the underlying process from functioning.
146146

147-
## Deploying to AWS Lambda
147+
## Deploying to AWS Lambda
148148

149149
To deploy Lambda functions to AWS Lambda, you need to compile the code for Amazon Linux which is the OS used on AWS Lambda microVMs, package it as a Zip file, and upload to AWS.
150150

@@ -160,7 +160,7 @@ The library defines three protocols for the implementation of a Lambda Handler.
160160

161161
### ByteBufferLambdaHandler
162162

163-
An `EventLoopFuture` based processing protocol for a Lambda that takes a `ByteBuffer` and returns a `ByteBuffer?` asynchronously.
163+
An `EventLoopFuture` based processing protocol for a Lambda that takes a `ByteBuffer` and returns a `ByteBuffer?` asynchronously.
164164

165165
`ByteBufferLambdaHandler` is the lowest level protocol designed to power the higher level `EventLoopLambdaHandler` and `LambdaHandler` based APIs. Users are not expected to use this protocol, though some performance sensitive applications that operate at the `ByteBuffer` level or have special serialization needs may choose to do so.
166166

0 commit comments

Comments
 (0)