-
Notifications
You must be signed in to change notification settings - Fork 0
/
serverless.yml
136 lines (129 loc) · 3.07 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
127
128
129
130
131
132
133
134
135
136
org: oleksandrfedoniuk
app: myserverlessproject
service: myserverlessproject
frameworkVersion: "2"
provider:
name: aws
runtime: nodejs12.x
profile: shelf-test
environment:
tableName: ${self:custom.tableName}
bucketName: ${self:custom.bucketName}
iamRoleStatements:
- Effect: Allow
Action:
- dynamodb:*
- s3:*
- ses:*
- sns:SetSMSAttributes
- sns:Publish
Resource: "*"
apiGateway:
apiKeys:
- free:
- myFreeKey
- paid:
- myPaidKey
usagePlan:
- free:
quota:
limit: 5000
period: MONTH
throttle:
burstLimit: 200
rateLimit: 100
- paid:
quota:
limit: 50000
period: MONTH
throttle:
burstLimit: 2000
rateLimit: 1000
plugins:
- serverless-s3-sync
- serverless-webpack
package:
individually: true
custom:
tableName: player-points
bucketName: myserverlessprojectuploadbucket-theretry
s3Sync:
- bucketName: ${self:custom.bucketName}
localDir: UploadData
functions:
getUser:
handler: lambda/endpoints/getUser.handler
events:
- http:
path: get-user/{ID}
method: GET
cors: true
getPlayerScore:
handler: lambda/endpoints/getPlayerScore.handler
events:
- http:
path: get-players-score/{ID}
method: GET
cors: true
createPlayerScore:
handler: lambda/endpoints/createPlayerScore.handler
events:
- http:
path: create-players-score/{ID}
method: POST
cors: true
private: true
createFile:
handler: lambda/endpoints/createFile.handler
events:
- http:
path: create-file/{fileName}
method: POST
cors: true
getFile:
handler: lambda/endpoints/getFile.handler
events:
- http:
path: get-file/{fileName}
method: GET
cors: true
sendEmail:
handler: lambda/endpoints/sendEmail.handler
events:
- http:
path: send-email/
method: POST
cors: true
sendSMS:
handler: lambda/endpoints/sendSMS.handler
events:
- http:
path: send-sms/
method: POST
cors: true
sendReminder:
handler: lambda/scheduledTasks/reminderEmail.handler
events:
- schedule: cron(25 19 ? * 5 *)
# min hours dayofthemonth dayoftheweek yearoffire
sendMorningNews:
handler: lambda/scheduledTasks/morningNews.handler
events:
- schedule: cron(10 20 ? * * *)
resources:
Resources:
DynamoDBTable:
Type: AWS::DynamoDB::Table
Properties:
TableName: ${self:custom.tableName}
AttributeDefinitions:
- AttributeName: ID
AttributeType: S
KeySchema:
- AttributeName: ID
KeyType: HASH
BillingMode: PAY_PER_REQUEST
DemoBucketUpload:
Type: AWS::S3::Bucket
Properties:
BucketName: ${self:custom.bucketName}