-
Notifications
You must be signed in to change notification settings - Fork 0
/
serverless.yml
executable file
·109 lines (97 loc) · 2.42 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
# Serverless.yml Reference
# https://serverless.com/framework/docs/providers/aws/guide/serverless.yml/
# Switch between credentials
# https://serverless.com/framework/docs/providers/aws/guide/credentials/
service: test-api
# Use the serverless-webpack plugin to transpile ES6
plugins:
- serverless-webpack
- serverless-offline
- serverless-jest-plugin
# Enable auto-packing of external modules
custom:
webpackIncludeModules: true
jest:
collectCoverage: true
provider:
name: aws
runtime: nodejs6.10
stage: prod
region: us-west-2
iamRoleStatements:
- Effect: Allow
Action:
- cognito-idp:*
Resource: arn:aws:cognito-idp:*:*:*
- Effect: Allow
Action:
- s3:PutObject
- s3:PutObjectAcl
- s3:GetObject
- s3:GetObjectAcl
Resource: arn:aws:s3:::bucket*
- Effect: Allow
Action:
- sns:publish
Resource: "*"
- Effect: Allow
Action:
- ses:SendEmail
Resource: "*"
functions:
auth:
handler: src/auth.handler
events:
- http:
path: auth
method: post
cors: true
environment:
UserPoolId: # Pool ID
ClientId: # Client ID
graphql:
handler: src/graphql.handler
events:
- http:
path: graphQL
method: post
cors: true
authorizer:
arn: # arn of authorizer (typically cognito user pool)
environment:
Region: # Region
UserPoolId: # UserPoolId
ClientId: # ClientId
ArangoDBName: # ArangoDBName
ArangoURL: # ArangoURL
ArangoUser: # ArangoUser
ArangoPW: # ArangoPW
Bucket: # Bucket
triggers:
handler: src/auth-triggers.handler
environment:
AppUrl: # AppUrl
ChangePasswordRoute: # ChangePasswordRoute
ResetPasswordRoute: # ResetPasswordRoute
UserPoolId: # UserPoolId
define-auth-challenge:
handler: src/define-auth-challenge.handler
create-auth-challenge:
handler: src/create-auth-challenge.handler
environment:
AppUrl: # AppUrl
verify-auth-challenge:
handler: src/verify-auth-challenge.handler
files:
handler: src/files.handler
events:
- http:
path: files
method: get
cors: true
authorizer:
arn: arn of authorizer (typically cognito user pool)
environment:
Region: # Region
Bucket: # Bucket
UserPoolId: # UserPoolId