-
Notifications
You must be signed in to change notification settings - Fork 2
/
forward.yaml
46 lines (43 loc) · 1.36 KB
/
forward.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
AWSTemplateFormatVersion: 2010-09-09
Transform: EventsRuleTargets
Description: Forwards Bitbucket events delivered by webhook to other AWS accounts
Parameters:
webhookstackname:
Description: Name of CloudFormation stack created by webhook.yaml
Type: String
Default: bitbucket-integration
arns:
Description: Receiver Event Bus ARNs. On the receiver account, edit the permissions on either the default event bus or a custom event bus to allow this AWS account to send events to the receiver account.
Type: List<String>
Resources:
ForwardRole:
Type: AWS::IAM::Role
Properties:
AssumeRolePolicyDocument:
Version: 2012-10-17
Statement:
- Effect: Allow
Principal:
Service:
- events.amazonaws.com
Action:
- sts:AssumeRole
Path: /
Policies:
- PolicyName: TrustEventsToForwardEvents
PolicyDocument:
Version: 2012-10-17
Statement:
- Effect: Allow
Action:
- events:PutEvents
Resource: !Ref arns
Forward:
Type: AWS::Events::Rule
Properties:
Description: Forwards Bitbucket events to other AWS accounts
RoleArn: !GetAtt ForwardRole.Arn
EventPattern:
source:
- !Ref webhookstackname
State: ENABLED