-
Notifications
You must be signed in to change notification settings - Fork 0
/
template.yaml
79 lines (70 loc) · 2.15 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
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
AWSTemplateFormatVersion: "2010-09-09"
Transform: AWS::Serverless-2016-10-31
Description: >
eb-catch-all
SAM Template for eb-catch-all
Resources:
MyEventBus:
Type: AWS::Events::EventBus
Properties:
Name: MyEventBus
CatchAllWithPrefixLogGroup:
Type: AWS::Logs::LogGroup
Properties:
RetentionInDays: 7
LogGroupName: /aws/events/CatchAllWithPrefixLogGroup
EventRuleCatchAllWithPrefix:
Type: AWS::Events::Rule
Properties:
Description: "EventRule to catch all using prefix"
EventBusName: !Ref MyEventBus
EventPattern:
source:
- prefix: ""
Targets:
- Arn: !GetAtt CatchAllWithPrefixLogGroup.Arn
Id: "TargetCatchAllWithPrefix"
CatchAllWithVersionLogGroup:
Type: AWS::Logs::LogGroup
Properties:
RetentionInDays: 7
LogGroupName: /aws/events/CatchAllWithVersionLogGroup
EventRuleCatchAllWithVersion:
Type: AWS::Events::Rule
Properties:
Description: "EventRule to catch all using version"
EventBusName: !Ref MyEventBus
EventPattern:
version: ["0"]
Targets:
- Arn: !GetAtt CatchAllWithVersionLogGroup.Arn
Id: "TargetCatchAllWithVersion"
CatchAllWithWildcardLogGroup:
Type: AWS::Logs::LogGroup
Properties:
RetentionInDays: 7
LogGroupName: /aws/events/CatchAllWithWildcardLogGroup
EventRuleCatchAllWithWildcard:
Type: AWS::Events::Rule
Properties:
Description: "EventRule to catch all using wildcard"
EventBusName: !Ref MyEventBus
EventPattern:
source:
- wildcard: "*"
Targets:
- Arn: !GetAtt CatchAllWithWildcardLogGroup.Arn
Id: "TargetCatchAllWithWildcard"
Outputs:
EventBus:
Description: "Event Bus"
Value: !Ref MyEventBus
CatchAllWithPrefixLogGroup:
Description: "Log group - Catch all with prefix"
Value: !Ref CatchAllWithPrefixLogGroup
CatchAllWithVersionLogGroup:
Description: "Log group - Catch all with version"
Value: !Ref CatchAllWithVersionLogGroup
CatchAllWithWildcardLogGroup:
Description: "Log group - Catch all with wildcard"
Value: !Ref CatchAllWithWildcardLogGroup