-
Notifications
You must be signed in to change notification settings - Fork 1
/
serverless.yml
56 lines (51 loc) · 1.17 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
service: serverless-flask-sample
plugins:
- serverless-python-requirements
- serverless-wsgi
custom:
tableName: 'todos-${self:provider.stage}'
wsgi:
app: main.app
packRequirements: false
provider:
name: aws
runtime: python3.6
stage: dev
region: ap-northeast-1
iamRoleStatements:
- Effect: Allow
Action:
- dynamodb:Query
- dynamodb:Scan
- dynamodb:GetItem
- dynamodb:PutItem
- dynamodb:UpdateItem
- dynamodb:DeleteItem
Resource:
- { "Fn::GetAtt": ["TodosDynamoDBTable", "Arn" ] }
environment:
TODOS_TABLE: ${self:custom.tableName}
functions:
app:
handler: wsgi.handler
events:
- http: ANY /
- http: 'ANY {proxy+}'
resources:
Resources:
TodosDynamoDBTable:
Type: 'AWS::DynamoDB::Table'
DeletionPolicy: Retain
Properties:
TableName: ${self:custom.tableName}
AttributeDefinitions:
-
AttributeName: id
AttributeType: S
KeySchema:
-
AttributeName: id
KeyType: HASH
ProvisionedThroughput:
ReadCapacityUnits: 1
WriteCapacityUnits: 1