-
Notifications
You must be signed in to change notification settings - Fork 0
/
serverless.yml
71 lines (65 loc) · 1.51 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
service: streaming-user-service
# app and org for use with dashboard.serverless.com
#app: your-app-name
#org: your-org-name
frameworkVersion: '>=1.28.0 <2.0.0'
### OWN
profile: serverless-admin
region: us-west-2
provider:
name: aws
runtime: go1.x
environment:
TABLE_NAME: users-${opt:stage, self:provider.stage}
API_SECRET: as45qasdfjdfhj88988fag6gjsketyvnvnmdfdf
iamRoleStatements:
- Effect: Allow
Action:
- dynamodb:DescribeTable
- dynamodb:Query
- dynamodb:Scan
- dynamodb:GetItem
- dynamodb:PutItem
- dynamodb:UpdateItem
- dynamodb:DeleteItem
Resource: "arn:aws:dynamodb:*:*:*"
package:
individually: true
exclude:
- ./**
functions:
createUser:
handler: bin/createUser
package:
include:
- ./bin/createUser
events:
- http:
path: users
method: post
cors: true
loginUser:
handler: bin/loginUser
package:
include:
- ./bin/loginUser
events:
- http:
path: login
method: post
cors: true
resources:
Resources:
StreamingUserServiceTable:
Type: AWS::DynamoDB::Table
Properties:
TableName: 'users-${opt:stage, self:provider.stage}'
ProvisionedThroughput:
ReadCapacityUnits: 1
WriteCapacityUnits: 1
AttributeDefinitions:
- AttributeName: Email
AttributeType: S
KeySchema:
- AttributeName: Email
KeyType: HASH