-
Notifications
You must be signed in to change notification settings - Fork 16
/
serverless.yml
77 lines (71 loc) · 1.63 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
service: my-service
provider:
name: aliyun
runtime: nodejs6
credentials: ~/.aliyuncli/credentials # path must be absolute
ramRoleStatements:
- Effect: Allow
Action:
- oss:GetObject
- oss:PutObject
Resource:
- '*'
plugins:
- serverless-aliyun-function-compute
package:
exclude:
- package-lock.json
- .gitignore
- .git/**
- node_modules/** # exclude all node_modules....
include:
- node_modules/moment/** # except necessary ones
excludeDevDependencies: false
functions:
postTest:
handler: index.postHandler
events:
- http:
path: /baz
method: post
requestMode: mapping
bodyFormat: form
parameters:
- name: foo
type: string
location: body
optional: true
default: bar
demo: bar
description: foo
getTest:
handler: index.getHandler
events:
- http:
path: /quo
method: get
requestMode: mapping
postTest2:
handler: index.postHandler
events:
- https:
path: /baz2
method: post
getTest2:
handler: index.getHandler
events:
- https:
path: /quo2
method: get
ossTriggerTest:
handler: index.ossTriggerHandler
events:
- oss:
sourceArn: acs:oss:cn-shanghai:${env:ALIYUN_ACCOUNT}:my-service-resource
triggerConfig:
events:
- oss:ObjectCreated:PostObject
- oss:ObjectCreated:PutObject
filter:
key:
prefix: source/