-
Notifications
You must be signed in to change notification settings - Fork 4
/
template.yml
49 lines (47 loc) · 1.42 KB
/
template.yml
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
AWSTemplateFormatVersion: 2010-09-09
Transform: AWS::Serverless-2016-10-31
Parameters:
SourceTableStreamARN:
Type: String
Description: DynamoDB table name of source table to be copied
DestinationTableName:
Type: String
Description: DynamoDB table name of destination table to copy data to
StreamProcessorTimeout:
Type: Number
Default: 60
MinValue: 30
MaxValue: 300
Description: Timeout of the DynamoDB Stream Lambda function.
StreamProcessorBatchSize:
Default: 5
Type: String
Description: Batch size of DynamoDB Stream Lambda Trigger.
Resources:
DynamoDBCopier:
Type: 'AWS::Serverless::Function'
Properties:
CodeUri: target/ddb-copier-1.0.1-SNAPSHOT.jar
Runtime: java8
Handler: 'com.jlhood.ddbcopier.lambda.Handler::handleRequest'
Tracing: Active
MemorySize: 1536
Timeout: !Ref StreamProcessorTimeout
Policies:
- DynamoDBCrudPolicy:
TableName: !Ref DestinationTableName
Environment:
Variables:
DESTINATION_TABLE_NAME: !Ref DestinationTableName
Events:
Stream:
Type: DynamoDB
Properties:
Stream: !Ref SourceTableStreamARN
StartingPosition: TRIM_HORIZON
BatchSize: !Ref StreamProcessorBatchSize
Outputs:
DynamoDBCopierFunctionName:
Value: !Ref DynamoDBCopier
DynamoDBCopierFunctionARN:
Value: !GetAtt DynamoDBCopier.Arn