-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathworkshop-big-data-streaming-cf.yaml
48 lines (48 loc) · 1.2 KB
/
workshop-big-data-streaming-cf.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
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: 1Strategy Big Data Streaming Workshop CloudFormation
Resources:
LimitShardSize:
Type: AWS::Serverless::Function
Properties:
FunctionName: 'limit_shard_size'
CodeUri: .
Description: ''
Handler: limit_shard_size.lambda_handler
MemorySize: 128
Runtime: python3.6
Timeout: 30
Policies:
-
AmazonKinesisFullAccess
EventRule:
Type: "AWS::Events::Rule"
Properties:
Description: "EventRule"
EventPattern:
source:
- "aws.kinesis"
detail-type:
- "AWS API Call via CloudTrail"
detail:
eventName:
- "CreateStream"
State: "ENABLED"
Targets:
-
Arn:
Fn::GetAtt:
- "LimitShardSize"
- "Arn"
Id: "TargetFunctionV1"
PermissionForEventsToInvokeLambda:
Type: "AWS::Lambda::Permission"
Properties:
FunctionName:
Ref: "LimitShardSize"
Action: "lambda:InvokeFunction"
Principal: "events.amazonaws.com"
SourceArn:
Fn::GetAtt:
- "EventRule"
- "Arn"