-
Notifications
You must be signed in to change notification settings - Fork 0
/
serverless.yml
73 lines (70 loc) · 1.55 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
service: aws-python-http-api-project
frameworkVersion: '3'
provider:
name: aws
runtime: python3.9
region: us-east-1
iam:
role:
statements:
- Effect: Allow
Action:
- dynamodb:PutItem
- dynamodb:UpdateItem
- dynamodb:GetItem
- dynamodb:scan
- dynamodb:DeleteItem
Resource:
Fn::Sub: "arn:aws:dynamodb:${AWS::Region}:${AWS::AccountId}:table/Cities"
functions:
status:
handler: src/handler.status
events:
- http:
path: /
method: get
insertItem:
handler: src/insertItem.handler
events:
- http:
path: /item
method: post
fetchItems:
handler: src/fetchItems.handler
events:
- http:
path: /items
method: get
getItem:
handler: src/getItem.handler
events:
- http:
path: /items/{Cidade}
method: get
updateItem:
handler: src/updateItem.handler
events:
- http:
path: /items/{Cidade}
method: put
deleteItem:
handler: src/deleteItem.handler
events:
- http:
path: /items/{Cidade}
method: delete
resources:
Resources:
ItemTableNew:
Type: AWS::DynamoDB::Table
Properties:
TableName: Cities
BillingMode: PAY_PER_REQUEST
AttributeDefinitions:
-
AttributeName: "Cidade"
AttributeType: "S"
KeySchema:
-
AttributeName: "Cidade"
KeyType: "HASH"