-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcloudformation.yml
48 lines (43 loc) · 1.44 KB
/
cloudformation.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
#{
# "detail-type": [
# "AWS API Call via CloudTrail"
# ],
# "detail": {
# "eventName": [
# "PurchaseReservedDBInstancesOffering",
# "PurchaseReservedInstancesOffering",
# "PurchaseReservedCacheNodesOffering",
# "PurchaseReservedCapacityOffering",
# "PurchaseReservedNodeOffering",
# "PurchaseScheduledInstances",
# "CreateSavingsPlan"
# ]
# }
#}
# Can't do cross-account SQS targets with EventBridge, so we need to target
# an EB bus on the receiving account.
# Development is the SOURCE environment for my events.
# Staging is the DESTINATION environment.
Resources:
DiscountPurchaseEventRule:
Type: AWS::Events::Rule
Properties:
Description: "Default Bus Listener for Discount Purchases (RI, SP)"
EventBusName: default
State: ENABLED
EventPattern:
detail-type:
- "AWS API Call via CloudTrail"
detail:
eventName:
- "PurchaseReservedDBInstancesOffering"
- "PurchaseReservedInstancesOffering"
- "PurchaseReservedCacheNodesOffering"
- "PurchaseReservedCapacityOffering"
- "PurchaseReservedNodeOffering"
- "PurchaseScheduledInstances"
- "CreateSavingsPlan"
Targets:
- Arn: "arn:aws:sqs:us-east-2:247216695226:EventBridgeNotificationTest"
Id: "2WDiscountPurchasesNotificationQueue"
# Client account must be whitelisted for PUT events on this queue.