-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathtemplate.yml
57 lines (54 loc) · 1.24 KB
/
template.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
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Resources:
TodoFunction:
Type: AWS::Serverless::Function
Properties:
Timeout: 10
Handler: main
Runtime: go1.x
Policies:
- AWSLambdaExecute
- DynamoDBCrudPolicy:
TableName: !Ref TodoTable
Events:
GetTodo:
Type: Api
Properties:
Path: /todo/{id}
Method: GET
GetTodos:
Type: Api
Properties:
Path: /todo
Method: GET
PutTodo:
Type: Api
Properties:
Path: /todo
Method: POST
DeleteTodo:
Type: Api
Properties:
Path: /todo/{id}
Method: DELETE
UpdateTodo:
Type: Api
Properties:
Path: /todo/{id}
Method: PUT
Metadata:
BuildMethod: makefile
TodoTable:
Type: AWS::DynamoDB::Table
Properties:
TableName: Todos
AttributeDefinitions:
- AttributeName: id
AttributeType: S
KeySchema:
- AttributeName: id
KeyType: HASH
ProvisionedThroughput:
ReadCapacityUnits: 2
WriteCapacityUnits: 2