-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathserverless.yml
More file actions
111 lines (107 loc) · 2.62 KB
/
serverless.yml
File metadata and controls
111 lines (107 loc) · 2.62 KB
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
service: shovel
provider:
name: aws
runtime: java8
iamRoleStatements:
-
Action:
- 'kinesis:Describe*'
- 'kinesis:Get*'
- 'kinesis:Put*'
Effect: Allow
Resource:
- Fn::Join:
- ''
-
- 'arn:aws:kinesis:'
- Ref: 'AWS::Region'
- ':'
- Ref: 'AWS::AccountId'
- ':'
- 'stream/'
- Ref: RawEventsStream
- Fn::Join:
- ''
-
- 'arn:aws:kinesis:'
- Ref: 'AWS::Region'
- ':'
- Ref: 'AWS::AccountId'
- ':'
- 'stream/'
- Ref: EnrichedEventsStream
- Fn::Join:
- ''
-
- 'arn:aws:kinesis:'
- Ref: 'AWS::Region'
- ':'
- Ref: 'AWS::AccountId'
- ':'
- 'stream/'
- Ref: BadEventsStream
package:
artifact: target/scala-2.11/serverless-collector.jar
functions:
options:
handler: io.github.acgray.shovel.collector.OptionsHandler
events:
- http:
path: /{proxy+}
method: options
headers:
- Access-Control-Allow-Origin
- Access-Control-Allow-Credentials
- Access-Control-Allow-Headers
collector:
handler: io.github.acgray.shovel.collector.CollectorHandler
environment:
KINESIS_STREAM_NAME:
Ref: RawEventsStream
events:
- http:
path: /{proxy+}
method: get
headers:
- Access-Control-Allow-Origin
- Access-Control-Allow-Credentials
- http:
path: /{proxy+}
method: post
headers:
- Access-Control-Allow-Origin
- Access-Control-Allow-Credentials
enrich:
handler: io.github.acgray.shovel.enrich.Handler
environment:
KINESIS_GOOD_STREAM_NAME:
Ref: EnrichedEventsStream
KINESIS_BAD_STREAM_NAME:
Ref: BadEventsStream
events:
- stream:
type: kinesis
arn:
Fn::GetAtt:
- RawEventsStream
- Arn
batchSize: 1
startingPosition: TRIM_HORIZON
enabled: true
resources:
Resources:
RawEventsStream:
Type: AWS::Kinesis::Stream
Properties:
ShardCount: 1
RetentionPeriodHours: 24
EnrichedEventsStream:
Type: AWS::Kinesis::Stream
Properties:
ShardCount: 1
RetentionPeriodHours: 24
BadEventsStream:
Type: AWS::Kinesis::Stream
Properties:
ShardCount: 1
RetentionPeriodHours: 24