-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtemplate.yaml
52 lines (48 loc) · 1.52 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
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: >
ordersapi
Sample SAM Template for ordersapi
Globals:
Function:
Runtime: java11
MemorySize: 512
Timeout: 30
Environment:
Variables:
ORDERS_TABLE: !Ref OrdersTable
Resources:
OrdersTable:
Type: AWS::Serverless::SimpleTable
Properties:
PrimaryKey:
Name: id
Type: Number
CreateOrderFunction:
Type: AWS::Serverless::Function # More info about Function Resource: https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#awsserverlessfunction
Properties:
CodeUri: ordersapi
Handler: com.psp316r.aws.lambda.apis.CreateOrderLambda::createOrder
Policies:
- DynamoDBCrudPolicy:
TableName: !Ref OrdersTable
Events:
OrderEvents:
Type: Api
Properties:
Path: /orders
Method: POST
ReadOrdersFunction:
Type: AWS::Serverless::Function # More info about Function Resource: https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#awsserverlessfunction
Properties:
CodeUri: ordersapi
Handler: com.psp316r.aws.lambda.apis.ReadOrdersLambda::getOrders
Policies:
- DynamoDBReadPolicy:
TableName: !Ref OrdersTable
Events:
OrderEvents:
Type: Api
Properties:
Path: /orders
Method: GET