-
Notifications
You must be signed in to change notification settings - Fork 0
/
serverless.yml
65 lines (59 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
service: left4status-api
frameworkVersion: '3'
# set up domain name manually in aws console
provider:
name: aws
runtime: nodejs16.x
architecture: arm64
memorySize: 512
region: us-west-2
environment:
TIMESTREAM_DATABASE: ${self:service}-${sls:stage}
httpApi:
cors: true
# set to false if no custom domain name is setup
disableDefaultEndpoint: true
iam:
role:
statements:
- Effect: Allow
Action:
- timestream:DescribeEndpoints
- timestream:Select
- timestream:CancelQuery
- timestream:ListTables
- timestream:ListMeasures
- timestream:DescribeTable
- timestream:DescribeDatabase
- timestream:SelectValues
- timestream:WriteRecords
- timestream:CreateTable
- timestream:DeleteTable
- timestream:UpdateTable
Resource: "*"
functions:
status:
handler: functions/status.status
events:
- httpApi:
path: /status
method: get
history:
handler: functions/history.history
timeout: 15
events:
- httpApi:
path: /history
method: get
update:
handler: functions/update.update
timeout: 15
events:
- schedule: rate(5 minutes)
resources:
Resources:
TimestreamTable:
Type: 'AWS::Timestream::Database'
DeletionPolicy: Retain
Properties:
DatabaseName: ${self:provider.environment.TIMESTREAM_DATABASE}