Skip to content

Commit

Permalink
feat(events): add multiple event bus policies on a single event bus (#…
Browse files Browse the repository at this point in the history
…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*
  • Loading branch information
postsa committed Dec 19, 2023
1 parent cf923bc commit 4dde502
Show file tree
Hide file tree
Showing 11 changed files with 204 additions and 89 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Expand Up @@ -6,10 +6,9 @@
"Name": "StackBusAA0A1E4B"
}
},
"BusPolicyCF00D793": {
"BusStatement1B4D0336C": {
"Type": "AWS::Events::EventBusPolicy",
"Properties": {
"StatementId": "123",
"EventBusName": {
"Ref": "BusEA82B648"
},
Expand All @@ -21,7 +20,11 @@
"Fn::Join": [
"",
[
"arn:aws:iam::",
"arn:",
{
"Ref": "AWS::Partition"
},
":iam::",
{
"Ref": "AWS::AccountId"
},
Expand All @@ -36,8 +39,47 @@
"Arn"
]
},
"Sid": "123"
}
"Sid": "Statement1"
},
"StatementId": "Statement1"
}
},
"BusStatement2B5FB314B": {
"Type": "AWS::Events::EventBusPolicy",
"Properties": {
"EventBusName": {
"Ref": "BusEA82B648"
},
"Statement": {
"Action": "events:PutRule",
"Effect": "Allow",
"Principal": {
"AWS": {
"Fn::Join": [
"",
[
"arn:",
{
"Ref": "AWS::Partition"
},
":iam::",
{
"Ref": "AWS::AccountId"
},
":root"
]
]
}
},
"Resource": {
"Fn::GetAtt": [
"BusEA82B648",
"Arn"
]
},
"Sid": "Statement2"
},
"StatementId": "Statement2"
}
}
},
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 4dde502

Please sign in to comment.