-
Notifications
You must be signed in to change notification settings - Fork 0
/
template.yaml
51 lines (47 loc) · 1.51 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
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: >
cloud-to-do-app
Globals:
Function:
Timeout: 3
MemorySize: 128
Resources:
GymClassTrackerTable:
Type: AWS::DynamoDB::Table
Properties:
TableName: to-do-table
AttributeDefinitions:
- AttributeName: id
AttributeType: S
KeySchema:
- AttributeName: id
KeyType: HASH
BillingMode: PAY_PER_REQUEST
CrudToDoFunction:
Type: AWS::Serverless::Function
Properties:
CodeUri: lambda_functions/crud_to_do/
Handler: app.lambda_handler
Runtime: python3.9
Architectures:
- x86_64
Events:
ToDo:
Type: Api
Properties:
Path: /to-dos
Method: get
Outputs:
# ServerlessRestApi is an implicit API created out of Events key under Serverless::Function
# Find out more about other implicit resources you can reference within SAM
# https://github.com/awslabs/serverless-application-model/blob/master/docs/internals/generated_resources.rst#api
ToDoApi:
Description: "API Gateway endpoint URL for Prod stage for To Do function"
Value: !Sub "https://${ServerlessRestApi}.execute-api.${AWS::Region}.amazonaws.com/Prod/to-dos/"
CrudToDoFunction:
Description: "for To Do List Lambda Function ARN"
Value: !GetAtt CrudToDoFunction.Arn
CrudToDoFunctionIamRole:
Description: "Implicit IAM Role created for To Do LIst function"
Value: !GetAtt CrudToDoFunctionRole.Arn