-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEventBridgeRule.yml
51 lines (50 loc) · 1.53 KB
/
EventBridgeRule.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
49
50
51
AWSTemplateFormatVersion: 2010-09-09
Parameters:
SecurityToolsAccountId:
Type: Number
Description: Account id of the Security Tools account.
Resources:
EventBridgeRole:
Type: AWS::IAM::Role
Properties:
AssumeRolePolicyDocument:
Version: 2012-10-17
Statement:
- Effect: Allow
Principal:
Service: events.amazonaws.com
Action: sts:AssumeRole
Policies:
- PolicyName: EventBridgePolicy
PolicyDocument:
Version: 2012-10-17
Statement:
- Effect: Allow
Action:
- events:PutEvents
Resource:
- !Sub "arn:aws:events:us-east-1:${SecurityToolsAccountId}:event-bus/default"
Description: Role to allow Event Bridge to send IAM events to Event Bus in Security Tools account
Path: /
RoleName: EventBridgeRole
EventBridgeRule:
Type: AWS::Events::Rule
Properties:
Description: Rule to send IAM events to Event Bus in Security Tools account
EventPattern:
source:
- aws.iam
detail-type:
- AWS API Call via CloudTrail
detail:
eventSource:
- iam.amazonaws.com
eventName:
- CreateRole
- UpdateAssumeRolePolicy
Name: EventBridgeRule
State: ENABLED
Targets:
- Arn: !Sub "arn:aws:events:us-east-1:${SecurityToolsAccountId}:event-bus/default"
RoleArn: !GetAtt EventBridgeRole.Arn
Id: id