-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserverless.yml
68 lines (63 loc) · 1.59 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
# serverless.yml
service: serverless-express-lambda
provider:
name: aws
runtime: nodejs8.10
stage: ${opt:stage, self:custom.defaultStage}
region: ${opt:region, self:custom.defaultRegion}
iamRoleStatements:
- Effect: Allow
Action:
- dynamodb:Query
- dynamodb:Scan
- dynamodb:GetItem
Resource: "*"
custom:
defaultStage: dev
defaultRegion: us-west-2
defaultCognitoPoolArn: arn:SOMETHING
plugins:
- serverless-offline
functions:
serverlessExpressApi:
name: ${self:provider.stage}-serverless-express-lambda
description: API definition written in express
handler: index.handler
memorySize: 128
timeout: 30
environment:
NODE_ENV: ${opt:stage, self:custom.defaultStage}
events:
- http:
path: /
method: ANY
cors: true
- http:
path: /docs/{proxy+}
method: ANY
cors: true
- http:
path: /{proxy+}
method: ANY
cors: true
authorizer:
arn: ${opt:cognitoPoolArn, self:custom.defaultCognitoPoolArn}
resources:
Resources:
userGiftTable:
Type: AWS::DynamoDB::Table
Properties:
TableName: user_gifts
AttributeDefinitions:
- AttributeName: email
AttributeType: S
- AttributeName: gift_id
AttributeType: N
KeySchema:
- AttributeName: email
KeyType: HASH
- AttributeName: gift_id
KeyType: RANGE
ProvisionedThroughput:
ReadCapacityUnits: 4
WriteCapacityUnits: 2