This repository has been archived by the owner on Nov 24, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 574
/
serverless.yml
126 lines (121 loc) · 2.62 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
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
service: chromeless-serverless
custom:
stage: dev
debug: "*"
awsIotHost: ${env:AWS_IOT_HOST}
chrome:
functions:
- run
provider:
name: aws
runtime: nodejs6.10
stage: ${self:custom.stage}
region: eu-west-1
environment:
DEBUG: ${self:custom.debug}
AWS_IOT_HOST: ${self:custom.awsIotHost}
apiKeys:
- ${self:custom.stage}-chromeless-session-key
iamRoleStatements:
- Effect: "Allow"
Action:
- "iot:Connect"
- "iot:Publish"
- "iot:Subscribe"
- "iot:Receive"
- "iot:GetThingShadow"
- "iot:UpdateThingShadow"
Resource: "*"
- Effect: "Allow"
Action:
- s3:*
Resource:
Fn::Join:
- ""
- - "arn:aws:s3:::"
- Ref: AWS::AccountId
- "-"
- Ref: AWS::Region
- -chromeless
- /*
plugins:
- serverless-plugin-typescript
- serverless-plugin-chrome
- serverless-offline
functions:
run:
memorySize: 1536
timeout: 300
handler: src/run.default
events:
- iot:
sql: "SELECT * FROM 'chrome/new-session'"
environment:
CHROMELESS_S3_BUCKET_NAME:
Fn::Join:
- ""
- - Ref: AWS::AccountId
- "-"
- Ref: AWS::Region
- -chromeless
CHROMELESS_S3_OBJECT_KEY_PREFIX: ""
CHROMELESS_S3_OBJECT_ACL: "public-read"
CHROMELESS_S3_BUCKET_URL:
Fn::GetAtt:
- Bucket
- DomainName
version:
memorySize: 128
handler: src/version.default
events:
- http:
path: /version
method: GET
session:
memorySize: 128
timeout: 10
handler: src/session.default
events:
- http:
method: OPTIONS
path: /
private: true
- http:
method: GET
path: /
private: true
disconnect:
memorySize: 256
handler: src/disconnect.default
timeout: 10
events:
- iot:
sql: "SELECT * FROM 'chrome/last-will'"
resources:
Resources:
RunLogGroup:
Properties:
RetentionInDays: 7
VersionLogGroup:
Properties:
RetentionInDays: 7
SessionLogGroup:
Properties:
RetentionInDays: 7
DisconnectLogGroup:
Properties:
RetentionInDays: 7
Bucket:
Type: AWS::S3::Bucket
Properties:
BucketName:
Fn::Join:
- ""
- - Ref: AWS::AccountId
- "-"
- Ref: AWS::Region
- -chromeless
LifecycleConfiguration:
Rules:
- ExpirationInDays: 1
Status: Enabled