-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathtemplate.yaml
executable file
·49 lines (44 loc) · 1.28 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
AWSTemplateFormatVersion: 2010-09-09
Transform: AWS::Serverless-2016-10-31
Description: chapter5-data-pipeline
Globals:
Function:
Runtime: java8
MemorySize: 512
Timeout: 10
Resources:
PipelineStartBucket:
Type: AWS::S3::Bucket
Properties:
BucketName: !Sub ${AWS::StackName}-${AWS::AccountId}-${AWS::Region}-start
FanOutTopic:
Type: AWS::SNS::Topic
BulkEventsLambda:
Type: AWS::Serverless::Function
Properties:
CodeUri: bulk-events-stage/target/lambda.zip
Handler: book.pipeline.bulk.BulkEventsLambda::handler
Environment:
Variables:
FAN_OUT_TOPIC: !Ref FanOutTopic
Policies:
- S3ReadPolicy:
BucketName: !Sub ${AWS::StackName}-${AWS::AccountId}-${AWS::Region}-start
- SNSPublishMessagePolicy:
TopicName: !GetAtt FanOutTopic.TopicName
Events:
S3Event:
Type: S3
Properties:
Bucket: !Ref PipelineStartBucket
Events: s3:ObjectCreated:*
SingleEventLambda:
Type: AWS::Serverless::Function
Properties:
CodeUri: single-event-stage/target/lambda.zip
Handler: book.pipeline.single.SingleEventLambda::handler
Events:
SnsEvent:
Type: SNS
Properties:
Topic: !Ref FanOutTopic