本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。
範例政策:將事件從特定規則傳送至不同區域中的 Amazon EventBridge 匯流排
下列範例政策授與帳戶 111122223333 權限,令其可將符合中東 (巴林) 和美國西部 (奧勒岡) 區域中以 SendToUSE1AnotherAccount 命名之規則的事件傳送至美國東部 (維吉尼亞北部) 帳戶 123456789012 中以 CrossRegionBus 命名的事件匯流排。範例政策會新增至帳戶 123456789012 CrossRegionBus 中指定的事件匯流排。只有當事件符合帳戶 111122223333 中為事件匯流排指定的規則時,此政策才允許事件。陳述式 Condition 會將事件限制為僅符合規則與指定規則 ARN 的事件。
- JSON
-
-
{
"Version":"2012-10-17",
"Statement": [
{
"Sid": "AllowSpecificRulesAsCrossRegionSource",
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::111112222333:root"
},
"Action": "events:PutEvents",
"Resource": "arn:aws:events:us-east-1:123456789012:event-bus/CrossRegionBus",
"Condition": {
"ArnEquals": {
"aws:SourceArn": [
"arn:aws:events:us-west-2:111112222333:rule/CrossRegionBus/SendToUSE1AnotherAccount",
"arn:aws:events:me-south-1:111112222333:rule/CrossRegionBus/SendToUSE1AnotherAccount"
]
}
}
}
]
}