1 00:00:00,180 --> 00:00:02,070 ‫So just a short lecture explaining 2 00:00:02,070 --> 00:00:06,270 ‫how to do multi-account event aggregation with EventBridge. 3 00:00:06,270 --> 00:00:09,660 ‫So say for example that you have multiple accounts in AWS 4 00:00:09,660 --> 00:00:12,420 ‫but you wanted to centrally manage some of these events 5 00:00:12,420 --> 00:00:14,580 ‫in a central account event bus. 6 00:00:14,580 --> 00:00:16,500 ‫And say you're launching EC2 instances 7 00:00:16,500 --> 00:00:19,290 ‫in all your accounts and you want to actually catch 8 00:00:19,290 --> 00:00:20,850 ‫these events in the central account. 9 00:00:20,850 --> 00:00:21,990 ‫So how would you do this? 10 00:00:21,990 --> 00:00:24,570 ‫Well, you would define an event pattern 11 00:00:24,570 --> 00:00:27,750 ‫in one of your accounts and then you would create 12 00:00:27,750 --> 00:00:30,660 ‫an event rule for it, so that all the state changes 13 00:00:30,660 --> 00:00:34,560 ‫of account A are sent to the event rule. 14 00:00:34,560 --> 00:00:37,470 ‫And it turns out that the targets of an event rule 15 00:00:37,470 --> 00:00:41,850 ‫in one account can be an event bus in another account. 16 00:00:41,850 --> 00:00:44,970 ‫So, to make it work, so that the account A 17 00:00:44,970 --> 00:00:46,680 ‫can send into the central accounts, 18 00:00:46,680 --> 00:00:50,070 ‫we need to create a resource policy on the event bus 19 00:00:50,070 --> 00:00:54,060 ‫of the central account to accept events from other accounts. 20 00:00:54,060 --> 00:00:55,410 ‫So that makes sense? 21 00:00:55,410 --> 00:00:57,210 ‫Then we can do the exact same pattern 22 00:00:57,210 --> 00:01:00,150 ‫in account B and D and C, 23 00:01:00,150 --> 00:01:03,120 ‫so that we have all the events and all the state changes 24 00:01:03,120 --> 00:01:07,110 ‫of our EC2 instances that will land onto the event bus 25 00:01:07,110 --> 00:01:08,490 ‫of the central accounts. 26 00:01:08,490 --> 00:01:11,400 ‫From there, we can just create the own event rule 27 00:01:11,400 --> 00:01:14,820 ‫on the event bus, for example to trigger SNS notifications, 28 00:01:14,820 --> 00:01:16,950 ‫or lender functions, or whatever you want. 29 00:01:16,950 --> 00:01:18,510 ‫So that's it, just one thing to know 30 00:01:18,510 --> 00:01:19,860 ‫in terms of architecture, 31 00:01:19,860 --> 00:01:23,043 ‫I hope you liked it and I will see you in the next lecture.