-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathserverless.yml
68 lines (63 loc) · 1.49 KB
/
serverless.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
service: async-extension-example
configValidationMode: error
provider:
name: aws
versionFunctions: false
runtime: nodejs16.x
logRetentionInDays: 3
environment:
STAGE: ${opt:stage, 'dev'}
httpApi:
payload: '2.0'
iam:
role:
statements:
- Effect: Allow
Action:
- lambda:InvokeFunction
Resource: '*'
layers:
asyncExtension:
path: src/asyncExtension
name: async-extension-${opt:stage, 'dev'}
description: Layer that executes a handler in an async fashion.
compatibleRuntimes:
- nodejs16.x
compatibleArchitectures:
- x86_64
- arm64
functions:
longRunning:
handler: /opt/proxy.handler
timeout: 100
environment:
ASYNC_HANDLER: src/api/async/longRunning
layers:
- !Ref AsyncExtensionLambdaLayer
events:
- httpApi:
path: /async/long
method: GET
customResponse:
handler: /opt/proxy.handler
timeout: 8
environment:
ASYNC_HANDLER: src/api/async/customResponse
CUSTOM_RES: '{"message": "Hello from custom response"}'
layers:
- !Ref AsyncExtensionLambdaLayer
events:
- httpApi:
path: /async/custom/res
method: GET
customHandler:
handler: src/api/customHandler.handler
timeout: 8
environment:
ASYNC_HANDLER: src/api/async/customHandler
layers:
- !Ref AsyncExtensionLambdaLayer
events:
- httpApi:
path: /async/custom/handler
method: GET