-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserverless.yml
76 lines (69 loc) · 1.94 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
service: simpleSwag
package:
individually: true
plugins:
- serverless-plugin-swag
# - serverless-plugin-browserify
custom:
swag:
globalCORS:
allowOrigins: "*"
allowHeaders: "Content-Type,Authorization,X-Amz-Date,X-Api-Key,X-Amz-Security-Token"
allowMethods: "DELETE,GET,HEAD,OPTIONS,PATCH,POST,PUT"
restApiId: ${self:custom.${self:provider.stage}.apigId}
dev:
profile: rynop
apigId: "yhpgg2jdev"
iamRoleArnLambda: "" #Not sure if we need this yet, or if the plugin can infer it. Need this when creating lambda
prod:
profile: aws-prod
apigId: "yhpgg2prod"
iamRoleArnLambda: ""
provider:
name: aws
runtime: nodejs4.3
stage: dev
region: us-east-1
deploymentBucket: ${self:provider.stage}-useast1-slsdeploys.alaynapage.org
profile: ${self:custom.${self:provider.stage}.profile}
iamRoleStatements:
- Effect: "Allow"
Action:
- "lambda:InvokeFunction"
Resource: arn:aws:lambda:${self:provider.region}:254269101111:function:${self:provider.stage}-${self:service}*
- Effect: "Allow"
Action:
- "s3:G*"
- "s3:L*"
Resource: "*"
functions:
pagesList:
name: ${self:provider.stage}-${self:service}-pagesList
description: list pages
handler: pages/list.hello
memorySize: 512
timeout: 10 # optional, default is 6
events:
- http: #swag plugin will ignore
path: pages
method: get
pagesGet:
name: ${self:provider.stage}-${self:service}-pagesGet
description: get page
handler: pages/get.hello
memorySize: 512
timeout: 10 # optional, default is 6
events:
- swagHttp:
path: pages/{id}
method: get
pagesUpdate:
name: ${self:provider.stage}-${self:service}-pagesUpdate
description: update Page
handler: pages/update.hello
memorySize: 512
timeout: 10 # optional, default is 6
events:
- swagHttp:
path: pages
method: put