Skip to content

Commit 4dde502

Browse files
authored
feat(events): add multiple event bus policies on a single event bus (#27340)
Enable the creation of multiple event bus policies on a single event bus. Closes #24671. The result of the Policies created by the integration test is a resource policy on the event bus that looks like ```json { "Version": "2012-10-17", "Statement": [{ "Sid": "Statement2", "Effect": "Allow", "Principal": { "AWS": "arn:aws:iam::<account-id>:root" }, "Action": "events:PutRule", "Resource": "arn:aws:events:us-west-2:<account-id>:event-bus/StackBusAA0A1E4B" }, { "Sid": "Statement1", "Effect": "Allow", "Principal": { "AWS": "arn:aws:iam::<account-id>:root" }, "Action": "events:PutEvents", "Resource": "arn:aws:events:us-west-2:<account-id>:event-bus/StackBusAA0A1E4B" }] } ``` ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent cf923bc commit 4dde502

File tree

11 files changed

+204
-89
lines changed

11 files changed

+204
-89
lines changed
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-events/test/integ.eventbus.js.snapshot/Stack.assets.json

+6-7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-events/test/integ.eventbus.js.snapshot/Stack.template.json

+47-5
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,9 @@
66
"Name": "StackBusAA0A1E4B"
77
}
88
},
9-
"BusPolicyCF00D793": {
9+
"BusStatement1B4D0336C": {
1010
"Type": "AWS::Events::EventBusPolicy",
1111
"Properties": {
12-
"StatementId": "123",
1312
"EventBusName": {
1413
"Ref": "BusEA82B648"
1514
},
@@ -21,7 +20,11 @@
2120
"Fn::Join": [
2221
"",
2322
[
24-
"arn:aws:iam::",
23+
"arn:",
24+
{
25+
"Ref": "AWS::Partition"
26+
},
27+
":iam::",
2528
{
2629
"Ref": "AWS::AccountId"
2730
},
@@ -36,8 +39,47 @@
3639
"Arn"
3740
]
3841
},
39-
"Sid": "123"
40-
}
42+
"Sid": "Statement1"
43+
},
44+
"StatementId": "Statement1"
45+
}
46+
},
47+
"BusStatement2B5FB314B": {
48+
"Type": "AWS::Events::EventBusPolicy",
49+
"Properties": {
50+
"EventBusName": {
51+
"Ref": "BusEA82B648"
52+
},
53+
"Statement": {
54+
"Action": "events:PutRule",
55+
"Effect": "Allow",
56+
"Principal": {
57+
"AWS": {
58+
"Fn::Join": [
59+
"",
60+
[
61+
"arn:",
62+
{
63+
"Ref": "AWS::Partition"
64+
},
65+
":iam::",
66+
{
67+
"Ref": "AWS::AccountId"
68+
},
69+
":root"
70+
]
71+
]
72+
}
73+
},
74+
"Resource": {
75+
"Fn::GetAtt": [
76+
"BusEA82B648",
77+
"Arn"
78+
]
79+
},
80+
"Sid": "Statement2"
81+
},
82+
"StatementId": "Statement2"
4183
}
4284
}
4385
},

packages/@aws-cdk-testing/framework-integ/test/aws-events/test/integ.eventbus.js.snapshot/cdk.out

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-events/test/integ.eventbus.js.snapshot/integ.json

+4-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-events/test/integ.eventbus.js.snapshot/manifest.json

+25-17
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)