-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserverless.yml
80 lines (77 loc) · 1.7 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
service: yyt-config-api
provider:
name: aws
runtime: nodejs8.10
stage: production
region: ap-northeast-2
iamRoleStatements:
- Effect: 'Allow'
Action:
- 's3:HeadObject'
- 's3:GetObject'
- 's3:PutObject'
- 's3:PutObjectAcl'
- 's3:DeleteObject'
Resource:
- 'arn:aws:s3:::${env:CONFIG_BUCKET}/*'
environment:
CONFIG_BUCKET: ${env:CONFIG_BUCKET}
CONFIG_SECRET: ${env:CONFIG_SECRET}
plugins:
- serverless-webpack
- serverless-offline
functions:
authorizeToken:
handler: src/index.authorizeToken
memorySize: 128
timeout: 5
events:
- http:
path: /auth/{systemKey}
method: put
request:
parameters:
paths:
systemKey: true
deleteToken:
handler: src/index.deleteToken
memorySize: 128
timeout: 5
events:
- http:
path: /auth/{systemKey}
method: delete
request:
parameters:
paths:
systemKey: true
listAuthorizedTokens:
handler: src/index.listAuthorizedTokens
memorySize: 128
timeout: 5
events:
- http:
path: /auth/{systemKey}
method: get
request:
parameters:
paths:
systemKey: true
validateToken:
handler: src/index.validateToken
memorySize: 128
timeout: 5
events:
- http:
path: /auth/{systemKey}
method: post
request:
parameters:
paths:
systemKey: true
resources:
Resources:
ConfigBucket:
Type: AWS::S3::Bucket
Properties:
BucketName: ${env:CONFIG_BUCKET}