-
Notifications
You must be signed in to change notification settings - Fork 22
Expand file tree
/
Copy pathserverless.yml
More file actions
166 lines (153 loc) · 3.83 KB
/
serverless.yml
File metadata and controls
166 lines (153 loc) · 3.83 KB
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
service: virtual-smart-home
configValidationMode: warn
plugins:
- serverless-plugin-select
- serverless-webpack
provider:
name: aws
runtime: nodejs22.x
region: eu-west-1 #eu-west-1, us-east-1, us-west-2
stage: dev
memorySize: 260
logRetentionInDays: 3
environment:
IS_PROD: ${env:IS_PROD}
VSH_IOT_REGION: 'eu-west-1'
VSH_IOT_ENDPOINT: ${env:IOT_ENDPOINT}
ALEXA_CLIENT_ID: ${env:ALEXA_CLIENT_ID}
ALEXA_CLIENT_SECRET: ${env:ALEXA_CLIENT_SECRET}
HASH_SECRET: ${env:HASH_SECRET}
MOMENTO_TOKEN: ${env:MOMENTO_TOKEN}
LOG_LEVEL: ${env:LOG_LEVEL}
VSH_LATEST_CLIENT_VERSION: '4.1.10'
LOG_INSPECT_DEPTH: 8
iam:
role:
statements:
- Effect: Allow
Action:
- iot:*
Resource:
- '*'
- Effect: Allow
Action:
- dynamodb:*
Resource:
- !Sub arn:aws:dynamodb:${self:provider.environment.VSH_IOT_REGION}:${AWS::AccountId}:table/VSH
- Effect: Allow
Action:
- cloudwatch:PutMetricData
- logs:StartQuery
- logs:GetQueryResults
Resource:
- '*'
custom:
myStage: ${opt:stage, self:provider.stage} #self:custom.myStage
myRegion: ${opt:region, self:provider.region} #self:custom.myRegion
myAccountId: !Sub ${AWS::AccountId} #self:custom.myAccountId
functions:
skill:
regions:
- eu-west-1
- us-east-1
- us-west-2
handler: handler.skill
timeout: 10
memorySize: 265
maximumRetryAttempts: 0
events:
- alexaSmartHome:
appId: ${env:SKILL_ID}
backchannel:
regions:
- ${self:provider.environment.VSH_IOT_REGION}
handler: handler.backchannel
timeout: 30
memorySize: 265
cleanup:
regions:
- ${self:provider.environment.VSH_IOT_REGION}
handler: cleanup.cleanup
timeout: 300
memorySize: 350
maximumRetryAttempts: 0
environment:
VSH_IOT_POLICY:
Ref: 'vshClientPolicy2'
events:
- schedule: cron(0 3 * * ? *)
metrics:
regions:
- ${self:provider.environment.VSH_IOT_REGION}
handler: metrics.metrics
timeout: 15
memorySize: 200
maximumRetryAttempts: 0
events:
- schedule: cron(0/15 * * * ? *)
backendApi:
regions:
- ${self:provider.environment.VSH_IOT_REGION}
handler: backendApi.server
maximumRetryAttempts: 0
memorySize: 220
environment:
VSH_IOT_POLICY:
Ref: 'vshClientPolicy2'
STRIPE_API_KEY: ${env:STRIPE_API_KEY}
STRIPE_WEBHOOK_SECRET: ${env:STRIPE_WEBHOOK_SECRET}
PADDLE_API_KEY: ${env:PADDLE_API_KEY}
PADDLE_WEBHOOK_SECRET: ${env:PADDLE_WEBHOOK_SECRET}
events:
- http:
path: provision
method: post
cors: true
- http:
path: devices
method: get
cors: true
- http:
path: device
method: delete
cors: true
- http:
path: check_version
method: get
cors: true
- http:
path: plan
method: get
cors: true
- http:
path: checkout
method: get
cors: false
- http:
path: subscription
method: get
cors: false
- http:
path: stripe_redirect
method: get
cors: false
- http:
path: stripe_webhook
method: post
cors: false
- http:
path: paddle_webhook
method: post
cors: false
admin:
regions:
- ${self:provider.environment.VSH_IOT_REGION}
handler: admin.admin
maximumRetryAttempts: 0
timeout: 25
memorySize: 260
environment:
VSH_ADMIN_API_KEY: ${env:VSH_ADMIN_API_KEY}
events:
- httpApi: '*'
resources: ${file(cloudFormation-${self:custom.myRegion}.yml)}