-
Notifications
You must be signed in to change notification settings - Fork 12
/
template.yaml
57 lines (53 loc) · 1.24 KB
/
template.yaml
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
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: >
builder-bootcamp-nodejs-starter-kit
Globals:
Function:
Timeout: 3
Resources:
GetLambdaFunction:
Type: AWS::Serverless::Function
Properties:
CodeUri: ./dist/src
Handler: get.handler
Runtime: nodejs12.x
Events:
GetData:
Type: Api
Properties:
Path: /data/{data}
Method: GET
Policies:
- DynamoDBReadPolicy:
TableName: 'data-table'
PostLambdaFunction:
Type: AWS::Serverless::Function
Properties:
CodeUri: ./dist/src
Handler: post.handler
Runtime: nodejs12.x
Events:
PostData:
Type: Api
Properties:
Path: /data
Method: POST
Policies:
- DynamoDBCrudPolicy:
TableName: 'data-table'
DataTable:
Type: AWS::DynamoDB::Table
Properties:
AttributeDefinitions:
-
AttributeName: "data"
AttributeType: "S"
KeySchema:
-
AttributeName: "data"
KeyType: "HASH"
ProvisionedThroughput:
ReadCapacityUnits: "5"
WriteCapacityUnits: "5"
TableName: "data-table"