Amazon EventBridge 的動作、資源和條件索引鍵 - 服務授權參考

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

Amazon EventBridge 的動作、資源和條件索引鍵

Amazon EventBridge (服務字首:events) 提供以下服務特定的資源、動作和條件內容金鑰以使用 IAM 許可政策。

參考資料:

Amazon EventBridge 定義的動作

您可在 IAM 政策陳述式的 Action 元素中指定以下動作。使用政策來授予在 AWS 中執行操作的許可。在政策中使用動作時,通常會允許或拒絕存取相同名稱的 API 操作或 CLI 命令。不過,在某些情況下,單一動作可控制對多個操作的存取。或者,某些操作需要多種不同的動作。

「動作」資料表的資源類型欄會指出每個動作是否支援資源層級的許可。如果此欄沒有值,您必須在政策陳述式的 Resource 元素中指定政策適用的所有資源 ("*")。如果此欄包含資源類型,則您可以在包含該動作的陳述式中指定該類型的 ARN。如果動作具有一或多個必要資源,呼叫者必須具有對這些資源使用動作的許可。表格中的必要資源會以星號 (*) 表示。如果您使用 IAM 政策中的 Resource 元素限制資源存取,則每種必要的資源類型必須要有 ARN 或模式。某些動作支援多種資源類型。如果資源類型是選用 (未顯示為必要),則您可以選擇使用其中一種選用資源類型。

「動作」資料表的條件索引鍵欄包含您可以在政策陳述式的 Condition 元素中指定的索引鍵。如需有關與服務資源相關聯之條件索引鍵的詳細資訊,請參閱「資源類型」資料表的條件索引鍵欄。

注意

資源條件索引鍵會列在資源類型資料表中。您可以在「動作」資料表的資源類型 (*必填) 欄中找到適用於動作的資源類型連結。「資源類型」資料表中的資源類型包括條件索引鍵欄,其中包含套用至「動作」資料表中動作的資源條件索引鍵。

如需下表各欄的詳細資訊,請參閱動作資料表

動作 描述 存取層級 資源類型 (*必填項目) 條件索引鍵 相依動作
ActivateEventSource 准許啟用合作夥伴事件來源 寫入

event-source*

CancelReplay 准許取消重新執行 寫入

replay*

CreateApiDestination 准許建立新的 API 目標 寫入

api-destination*

connection*

CreateArchive 准許建立新的封存 寫入

archive*

event-bus*

CreateConnection 准許建立新的連線 寫入

connection*

CreateEndpoint 准許建立端點 寫入

endpoint*

events:EventBusArn

CreateEventBus 准許建立事件匯流排 寫入

event-bus*

aws:RequestTag/${TagKey}

aws:TagKeys

CreatePartnerEventSource 准許建立合作夥伴事件來源 寫入

event-source*

DeactivateEventSource 准許停用事件來源 寫入

event-source*

DeauthorizeConnection 准許取消授權連線,刪除其存放的授權機密 寫入

connection*

DeleteApiDestination 准許刪除 API 目標 寫入

api-destination*

DeleteArchive 准許刪除封存 寫入

archive*

DeleteConnection 准許刪除連線 寫入

connection*

DeleteEndpoint 准許刪除端點 寫入

endpoint*

DeleteEventBus 准許刪除事件匯流排 寫入

event-bus*

DeletePartnerEventSource 准許刪除合作夥伴事件來源 寫入

event-source*

DeleteRule 准許刪除規則 寫入

rule-on-custom-event-bus

rule-on-default-event-bus

events:creatorAccount

events:ManagedBy

DescribeApiDestination 准許擷取關於 API 目標的詳細資訊 讀取

api-destination*

connection*

DescribeArchive 准許擷取封存詳細資訊 讀取

archive*

DescribeConnection 准許擷取關於連線的詳細資訊 讀取

connection*

DescribeEndpoint 准許擷取端點的詳細資訊 讀取

endpoint*

DescribeEventBus 准許擷取事件匯流排詳細資訊 讀取

event-bus

DescribeEventSource 准許擷取事件來源詳細資訊 讀取

event-source*

DescribePartnerEventSource 准許擷取合作夥伴事件來源詳細資訊 讀取

event-source*

DescribeReplay 准許擷取重新執行詳細資訊 讀取

replay*

DescribeRule 准許擷取規則詳細資訊 讀取

rule-on-custom-event-bus

rule-on-default-event-bus

events:creatorAccount

DisableRule 准許停用規則 寫入

rule-on-custom-event-bus

rule-on-default-event-bus

events:creatorAccount

events:ManagedBy

EnableRule 准許啟用規則 寫入

rule-on-custom-event-bus

rule-on-default-event-bus

events:creatorAccount

events:ManagedBy

InvokeApiDestination [僅限許可] 准許叫用 API 目標 寫入

api-destination*

ListApiDestinations 准許擷取 API 目標的清單 列出
ListArchives 准許擷取封存清單 列出
ListConnections 准許擷取連線清單 列出
ListEndpoints 准許擷取端點清單 列出
ListEventBuses 准許擷取帳戶中的事件匯流排清單 列出
ListEventSources 准許擷取與此帳戶共用的事件來源清單 列出
ListPartnerEventSourceAccounts 准許擷取與某個事件來源相關聯的 AWS 帳戶 ID 清單 列出

event-source*

ListPartnerEventSources 准許擷取合作夥伴事件來源清單 列出
ListReplays 准許擷取重新執行清單 列出
ListRuleNamesByTarget 准許擷取與某個目標相關聯的規則名稱清單 列出
ListRules 准許擷取帳戶中 Amazon EventBridge 規則清單 列出
ListTagsForResource 准許擷取與某個 Amazon EventBridge 資源相關聯的標籤清單 列出

event-bus

rule-on-custom-event-bus

rule-on-default-event-bus

events:creatorAccount

ListTargetsByRule 准許擷取為規則定義的目標清單 列出

rule-on-custom-event-bus

rule-on-default-event-bus

events:creatorAccount

PutEvents 准許將自訂事件傳送到 Amazon EventBridge 寫入

event-bus*

events:detail-type

events:source

events:eventBusInvocation

PutPartnerEvents 准許將自訂事件傳送到 Amazon EventBridge 寫入
PutPermission 准許使用 PutPermission 動作來為另一個 AWS 帳戶 授予將事件放入預設事件匯流排的許可 許可管理
PutRule 准許建立或更新規則 寫入

rule-on-custom-event-bus

rule-on-default-event-bus

events:detail.userIdentity.principalId

events:detail-type

events:source

events:detail.service

events:detail.eventTypeCode

aws:RequestTag/${TagKey}

aws:TagKeys

events:creatorAccount

events:ManagedBy

PutTargets 准許將目標新增至規則 寫入

rule-on-custom-event-bus

rule-on-default-event-bus

events:TargetArn

events:creatorAccount

events:ManagedBy

RemovePermission 准許撤銷另一個 AWS 帳戶 將事件放入預設事件匯流排的許可 許可管理
RemoveTargets 准許從規則移除目標 寫入

rule-on-custom-event-bus

rule-on-default-event-bus

events:creatorAccount

events:ManagedBy

RetrieveConnectionCredentials [僅限許可] 准許從連線擷取憑證 寫入

connection*

StartReplay 准許啟動重新執行封存 寫入

archive*

event-bus*

replay*

TagResource 准許將標籤新增至 Amazon EventBridge 資源 標記

event-bus

rule-on-custom-event-bus

rule-on-default-event-bus

aws:TagKeys

aws:RequestTag/${TagKey}

events:creatorAccount

TestEventPattern 准許測試某個事件模式是否符合提供的事件 讀取
UntagResource 准許將標籤從 Amazon EventBridge 資源中移除 標記

event-bus

rule-on-custom-event-bus

rule-on-default-event-bus

aws:TagKeys

events:creatorAccount

UpdateApiDestination 准許更新 API 目標 寫入

api-destination*

UpdateArchive 准許更新封存 寫入

archive*

UpdateConnection 准許更新連線 寫入

connection*

UpdateEndpoint 准許更新端點 寫入

endpoint*

events:EventBusArn

Amazon EventBridge 定義的資源類型

此服務會定義下列資源類型,並可用在 IAM 許可政策陳述式的 Resource 元素中。動作表格中的每個動作都代表可使用該動作指定的資源類型。資源類型也能定義您可以在政策中包含哪些條件索引鍵。這些索引鍵都會顯示在「資源類型」資料表的最後一欄。如需下表各欄的詳細資訊,請參閱資源類型資料表

資源類型 ARN 條件索引鍵
event-source arn:${Partition}:events:${Region}::event-source/${EventSourceName}
event-bus arn:${Partition}:events:${Region}:${Account}:event-bus/${EventBusName}

aws:ResourceTag/${TagKey}

rule-on-default-event-bus arn:${Partition}:events:${Region}:${Account}:rule/${RuleName}

aws:ResourceTag/${TagKey}

rule-on-custom-event-bus arn:${Partition}:events:${Region}:${Account}:rule/${EventBusName}/${RuleName}

aws:ResourceTag/${TagKey}

archive arn:${Partition}:events:${Region}:${Account}:archive/${ArchiveName}
replay arn:${Partition}:events:${Region}:${Account}:replay/${ReplayName}
connection arn:${Partition}:events:${Region}:${Account}:connection/${ConnectionName}
api-destination arn:${Partition}:events:${Region}:${Account}:api-destination/${ApiDestinationName}
endpoint arn:${Partition}:events:${Region}:${Account}:endpoint/${EndpointName}

Amazon EventBridge 的條件索引鍵

Amazon EventBridge 定義下列可在 IAM 政策的 Condition 元素中使用的條件索引鍵。您可以使用這些索引鍵來縮小套用政策陳述式的條件。如需下表各欄的詳細資訊,請參閱條件索引鍵表

若要檢視所有服務都可使用的全域條件索引鍵,請參閱可用的全域條件索引鍵

條件索引鍵 描述 類型
aws:RequestTag/${TagKey} 依每個標籤允許的值集,篩選對事件匯流排和規則動作的存取權 字串
aws:ResourceTag/${TagKey} 依與資源相關聯的標籤值,篩選對事件匯流排和規則動作的存取權 字串
aws:TagKeys 依請求中的標籤,篩選對事件匯流排和規則動作的存取權 ArrayOfString
events:EventBusArn 依可與端點建立關聯的事件匯流排 ARN,篩選 CreateEndpoint 和 UpdateEndpoint 動作的存取權 ArrayOfARN
events:ManagedBy 依 AWS 服務篩選存取權。如果規則是由代表你的 AWS 服務所建立,則該值為建立規則之服務主體之名稱 字串
events:TargetArn 依可放入 PutTargets 動作規則的目標 ARN,篩選存取權。TargetARN 不包含 DeadLetterConfigArn ArrayOfARN
events:creatorAccount 依建立規則的帳戶,篩選對規則動作的存取權 字串
events:detail-type 依事件詳細資訊類型的常值字串,篩選對 PutEvents 和 PutRule 動作的存取權 字串
events:detail.eventTypeCode 依事件 detail.eventTypeCode 欄位的常值字串,篩選對 PutRule 動作的存取權 字串
events:detail.service 依事件 detail.service 欄位的常值字串,篩選對 PutRule 動作的存取權 字串
events:detail.userIdentity.principalId 依事件 detail.useridentity.principalid 欄位的常值字串,篩選對 PutRule 動作的存取權 字串
events:eventBusInvocation 依事件是否透過 API 或跨帳戶匯流排叫用產生,篩選對 PutEvents 動作的存取權 字串
events:source 依產生事件的 AWS 服務或 AWS 合作夥伴事件來源,篩選對 PutEvents 和 PutRule 動作的存取權 符合事件來源欄位的常值字串。 ArrayOfString