-
Notifications
You must be signed in to change notification settings - Fork 0
/
serverless.yml
199 lines (194 loc) · 4.91 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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
# serverless.yml
service: my-python-application
provider:
name: aws
runtime: python3.7
stage: dev
region: us-east-2
environment:
DYNAMODB_TABLE: ${self:service}-${opt:stage, self:provider.stage}
iamRoleStatements:
- Effect: Allow
Action:
- dynamodb:Query
- dynamodb:Scan
- dynamodb:GetItem
- dynamodb:PutItem
- dynamodb:UpdateItem
- dynamodb:DeleteItem
Resource: "arn:aws:dynamodb:${opt:region, self:provider.region}:*:*"
functions:
home:
handler: index.home_handler
events:
- http:
path: home
method: get
integration: lambda
response:
headers:
Content-Type: "'text/html'"
template: $input.path('$')
actvities:
handler: index.activities_handler
events:
- http:
path: activities
method: get
integration: lambda
response:
headers:
Content-Type: "'text/html'"
template: $input.path('$')
registerComplete:
handler: index.register_complete_handler
events:
- http:
path: register-complete
method: get
integration: lambda
response:
headers:
Content-Type: "'text/html'"
template: $input.path('$')
sessionExpired:
handler: index.session_expired_handler
events:
- http:
path: session-expired
method: get
integration: lambda
response:
headers:
Content-Type: "'text/html'"
template: $input.path('$')
signIn:
handler: index.sign_in_handler
events:
- http:
path: sign-in
method: get
integration: lambda
response:
headers:
Content-Type: "'text/html'"
template: $input.path('$')
- http:
path: sign-in
method: post
integration: lambda
cors: true
response:
headers:
Set-Cookie: integration.response.body.cookie
signUp:
handler: index.sign_up_handler
events:
- http:
path: sign-up
method: get
integration: lambda
response:
headers:
Content-Type: "'text/html'"
template: $input.path('$')
- http:
path: sign-up
method: post
integration: lambda
cors: true
response:
headers:
Set-Cookie: integration.response.body.cookie
registerRSVP:
handler: index.register_rsvp_handler
events:
- http:
path: register-rsvp
method: get
integration: lambda
response:
headers:
Content-Type: "'text/html'"
template: $input.path('$')
- http:
path: register-rsvp
method: post
integration: lambda
cors: true
registerProfile:
handler: index.register_profile_handler
events:
- http:
path: register-profile
method: get
integration: lambda
response:
headers:
Content-Type: "'text/html'"
template: $input.path('$')
- http:
path: register-profile
method: post
integration: lambda
cors: true
registerActivities:
handler: index.register_activities_handler
events:
- http:
path: register-activities
method: get
integration: lambda
response:
headers:
Content-Type: "'text/html'"
template: $input.path('$')
- http:
path: register-activities
method: post
integration: lambda
cors: true
registerHotel:
handler: index.register_hotel_handler
events:
- http:
path: register-hotel
method: get
integration: lambda
response:
headers:
Content-Type: "'text/html'"
template: $input.path('$')
- http:
path: register-hotel
method: post
integration: lambda
cors: true
resources:
Resources:
usersTable:
Type: 'AWS::DynamoDB::Table'
DeletionPolicy: Delete
Properties:
AttributeDefinitions:
- AttributeName: id
AttributeType: S
- AttributeName: username
AttributeType: S
KeySchema:
- AttributeName: id
KeyType: HASH
ProvisionedThroughput:
ReadCapacityUnits: 1
WriteCapacityUnits: 1
TableName: usersTable
GlobalSecondaryIndexes:
- IndexName: userName
KeySchema:
- AttributeName: username
KeyType: HASH
Projection:
ProjectionType: KEYS_ONLY
ProvisionedThroughput:
ReadCapacityUnits: 1
WriteCapacityUnits: 1