-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserverless.yml
42 lines (36 loc) · 1.2 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
# serverless.yml
service: tbana
configValidationMode: error
provider:
name: aws
region: eu-north-1
runtime: nodejs12.x
stage: ${opt:stage, 'dev'}
memorySize: 128 # optional, in MB, default is 1024
timeout: 15 # optional, in seconds, default is 6
versionFunctions: false # optional, default is true
tracing:
lambda: false # optional, enables tracing for all functions (can be true (true equals 'Active') 'Active' or 'PassThrough')
plugins:
- serverless-offline
functions:
tbana-getDepartures:
handler: index.handler # required, handler set in AWS Lambda
name: tbana-getDepartures-${self:provider.stage} # optional, Deployed Lambda name
description: Get realtime departures given site and direction # optional, Description to publish to AWS
environment:
TRAFIKLAB_API_KEY: ${env:TRAFIKLAB_API_KEY}
events:
- http:
method: get
path: trains/departures
cors: true
custom:
stage: "${opt:stage, self:provider.stage}"
resources:
Resources:
ApiGatewayRestApi:
Type: AWS::ApiGateway::RestApi
Properties:
Name: ${self:service}-${self:custom.stage}
Description: Get realtime departures given site and direction