-
Notifications
You must be signed in to change notification settings - Fork 669
/
Copy pathtemplate.yaml
38 lines (37 loc) · 1.09 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
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: serverless-express + DynamoDB example
Resources:
ServerlessExpressFunction:
Type: AWS::Serverless::Function
Properties:
CodeUri: ./src
Handler: lambda.handler
MemorySize: 1024
Runtime: nodejs20.x
Timeout: 3
Events:
DynamoDB1:
Type: DynamoDB
Properties:
Stream: !GetAtt Table.StreamArn
StartingPosition: TRIM_HORIZON
BatchSize: 1
Table:
Type: 'AWS::DynamoDB::Table'
Properties:
AttributeDefinitions:
- AttributeName: id
AttributeType: S
KeySchema:
- AttributeName: id
KeyType: HASH
ProvisionedThroughput:
ReadCapacityUnits: 5
WriteCapacityUnits: 5
StreamSpecification:
StreamViewType: NEW_IMAGE
Outputs:
LambdaFunctionConsoleUrl:
Description: Console URL for the Lambda Function.
Value: !Sub https://${AWS::Region}.console.aws.amazon.com/lambda/home?region=${AWS::Region}#/functions/${ServerlessExpressFunction}