-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtemplate.yaml
More file actions
85 lines (81 loc) · 2.04 KB
/
template.yaml
File metadata and controls
85 lines (81 loc) · 2.04 KB
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
74
75
76
77
78
79
80
81
82
83
84
85
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: >
serverless-crud
Sample SAM Template for serverless-crud
Globals:
Api:
Cors:
AllowMethods: "'GET,POST,PUT,DELETE,OPTIONS'"
AllowHeaders: "'Content-Type,Access-Control-Allow-Origin'"
AllowOrigin: "'http://localhost:8001'"
Function:
Timeout: 3
MemorySize: 128
Resources:
ReadFunction:
Type: AWS::Serverless::Function
Properties:
CodeUri: crud/
Handler: read.lambda_handler
Runtime: python3.9
Architectures:
- x86_64
Events:
CRUD:
Type: Api
Properties:
Path: /
Method: get
CreateFunction:
Type: AWS::Serverless::Function
Properties:
CodeUri: crud/
Handler: create.lambda_handler
Runtime: python3.9
Architectures:
- x86_64
Events:
CRUD:
Type: Api
Properties:
Path: /
Method: post
UpdateFunction:
Type: AWS::Serverless::Function
Properties:
CodeUri: crud/
Handler: update.lambda_handler
Runtime: python3.9
Architectures:
- x86_64
Events:
CRUD:
Type: Api
Properties:
Path: /
Method: put
DeleteFunction:
Type: AWS::Serverless::Function
Properties:
CodeUri: crud/
Handler: delete.lambda_handler
Runtime: python3.9
Architectures:
- x86_64
Events:
CRUD:
Type: Api
Properties:
Path: /
Method: delete
Outputs:
HelloWorldApi:
Description: "API Gateway endpoint URL for Prod stage for Hello World function"
Value: !Sub "https://${ServerlessRestApi}.execute-api.${AWS::Region}.amazonaws.com/Prod/hello/"
HelloWorldFunction:
Description: "Hello World Lambda Function ARN"
Value: !GetAtt HelloWorldFunction.Arn
HelloWorldFunctionIamRole:
Description: "Implicit IAM Role created for Hello World function"
Value: !GetAtt HelloWorldFunctionRole.Arn