-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserverless.yml
More file actions
99 lines (92 loc) · 2.16 KB
/
Copy pathserverless.yml
File metadata and controls
99 lines (92 loc) · 2.16 KB
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
service: morc-trails-api
plugins:
- serverless-bundle
- serverless-domain-manager
- serverless-offline
custom:
stage: ${opt:stage, self:provider.stage}
domains:
ross: ross.morcmtb.info
aron: aron.morcmtb.info
dev: api.morcmtb.info
stage: stage-api.morcmtb.info
prod: api.morcmtb.org
certificates:
ross: "*.morcmtb.info"
aron: "*.morcmtb.info"
dev: "*.morcmtb.info"
stage: "*.morcmtb.info"
prod: "*.morcmtb.org"
tableName: ${self:custom.stage}-trails
customDomain:
enabled: false
domainName: ${self:custom.domains.${self:custom.stage}}
certificateName: ${self:custom.certificates.${self:custom.stage}}
basePath: "v1"
stage: ${self:custom.stage}
createRoute53Record: false
provider:
name: aws
runtime: nodejs10.x
stage: ${opt:stage, 'dev'}
region: us-east-2
environment:
tableName: ${self:custom.tableName}
package:
individually: true
iamRoleStatements:
- Effect: Allow
Action:
- dynamodb:DescribeTable
- dynamodb:Query
- dynamodb:Scan
- dynamodb:GetItem
- dynamodb:PutItem
- dynamodb:UpdateItem
- dynamodb:DeleteItem
Resource:
- "Fn::GetAtt": [TrailsTable, Arn]
functions:
create:
handler: service/create.main
events:
- http:
path: trails
method: post
cors: true
authorizer: aws_iam
get:
handler: service/get.main
events:
- http:
path: trails/{id}
method: get
cors: true
authorizer: aws_iam
list:
handler: service/list.main
events:
- http:
path: trails
method: get
cors: true
update:
handler: service/update.main
events:
- http:
path: trails/{id}
method: put
cors: true
authorizer: aws_iam
delete:
handler: service/delete.main
events:
- http:
path: trails/{id}
method: delete
cors: true
authorizer: aws_iam
resources:
- ${file(resources/dynamodb-table.yml)}
- ${file(resources/cognito-user-pool.yml)}
- ${file(resources/cognito-identity-pool.yml)}