範例政策:將事件傳送至相同的帳戶,並限制 Amazon EventBridge 中的更新 - Amazon EventBridge

本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。

範例政策:將事件傳送至相同的帳戶,並限制 Amazon EventBridge 中的更新

下列範例策略授與帳號 123456789012 權限,以建立、刪除、更新、停用和啟用規則,以及新增或移除目標。它會限制這些符合具有來源之事件的規則 com.exampleCorp.webStore,並使用 "events:creatorAccount": "${aws:PrincipalAccount}" 來確保只有帳戶 123456789012 可以在建立這些規則和目標之後修改這些規則和目標。

{ "Version": "2012-10-17", "Statement": [ { "Sid": "InvoiceProcessingRuleCreation", "Effect": "Allow", "Principal": { "AWS": "arn:aws:iam::123456789012:root" }, "Action": [ "events:PutRule", "events:DeleteRule", "events:DescribeRule", "events:DisableRule", "events:EnableRule", "events:PutTargets", "events:RemoveTargets" ], "Resource": "arn:aws:events:us-east-1:123456789012:rule/central-event-bus/*", "Condition": { "StringEqualsIfExists": { "events:creatorAccount": "${aws:PrincipalAccount}", "events:source": "com.exampleCorp.webStore" } } } ] }