View a markdown version of this page

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

AWS CodeCommit 的動作、資源和條件索引鍵

AWS CodeCommit (服務字首:codecommit) 提供下列服務特定的操作、資源、動作和條件索引鍵,可用於 IAM 許可政策。

參考資料:

AWS CodeCommit 定義的 API 操作

下表將 API 操作映射至其授權的 IAM 動作。只會列出具有指定 API 和動作靜態值的條件金鑰;如需每個動作支援的完整條件金鑰集,請參閱動作表格。

作業 IAM 動作 條件鍵 可能的值 (s) 存取層級

AssociateApprovalRuleTemplateWithRepository

codecommit:AssociateApprovalRuleTemplateWithRepository

寫入

BatchAssociateApprovalRuleTemplateWithRepositories

codecommit:BatchAssociateApprovalRuleTemplateWithRepositories

寫入

BatchDescribeMergeConflicts

codecommit:BatchDescribeMergeConflicts

讀取

BatchDisassociateApprovalRuleTemplateFromRepositories

codecommit:BatchDisassociateApprovalRuleTemplateFromRepositories

寫入

BatchGetCommits

codecommit:BatchGetCommits

讀取

BatchGetRepositories

codecommit:BatchGetRepositories

讀取

CreateApprovalRuleTemplate

codecommit:CreateApprovalRuleTemplate

寫入

CreateBranch

codecommit:CreateBranch

寫入

CreateCommit

codecommit:CreateCommit

寫入

CreatePullRequest

codecommit:CreatePullRequest

寫入

CreatePullRequestApprovalRule

codecommit:CreatePullRequestApprovalRule

寫入

CreateRepository

codecommit:CreateRepository

寫入

codecommit:TagResource

標記、寫入

CreateUnreferencedMergeCommit

codecommit:CreateUnreferencedMergeCommit

寫入

DeleteApprovalRuleTemplate

codecommit:DeleteApprovalRuleTemplate

寫入

DeleteBranch

codecommit:DeleteBranch

寫入

DeleteCommentContent

codecommit:DeleteCommentContent

寫入

DeleteFile

codecommit:DeleteFile

寫入

DeletePullRequestApprovalRule

codecommit:DeletePullRequestApprovalRule

寫入

DeleteRepository

codecommit:DeleteRepository

寫入

DescribeMergeConflicts

codecommit:DescribeMergeConflicts

讀取

DescribePullRequestEvents

codecommit:DescribePullRequestEvents

讀取

DisassociateApprovalRuleTemplateFromRepository

codecommit:DisassociateApprovalRuleTemplateFromRepository

寫入

EvaluatePullRequestApprovalRules

codecommit:EvaluatePullRequestApprovalRules

讀取

GetApprovalRuleTemplate

codecommit:GetApprovalRuleTemplate

讀取

GetBlob

codecommit:GetBlob

讀取

GetBlobDifferences

codecommit:GetBlobDifferences

讀取

GetBranch

codecommit:GetBranch

讀取

GetComment

codecommit:GetComment

讀取

GetCommentReactions

codecommit:GetCommentReactions

讀取

GetCommentsForComparedCommit

codecommit:GetCommentsForComparedCommit

讀取

GetCommentsForPullRequest

codecommit:GetCommentsForPullRequest

讀取

GetCommit

codecommit:GetCommit

讀取

GetDifferences

codecommit:GetDifferences

讀取

GetFile

codecommit:GetFile

讀取

GetFolder

codecommit:GetFolder

讀取

GetMergeCommit

codecommit:GetMergeCommit

讀取

GetMergeConflicts

codecommit:GetMergeConflicts

讀取

GetMergeOptions

codecommit:GetMergeOptions

讀取

GetPullRequest

codecommit:GetPullRequest

讀取

GetPullRequestApprovalStates

codecommit:GetPullRequestApprovalStates

讀取

GetPullRequestOverrideState

codecommit:GetPullRequestOverrideState

讀取

GetRepository

codecommit:GetRepository

讀取

GetRepositoryTriggers

codecommit:GetRepositoryTriggers

讀取

ListApprovalRuleTemplates

codecommit:ListApprovalRuleTemplates

清單

ListAssociatedApprovalRuleTemplatesForRepository

codecommit:ListAssociatedApprovalRuleTemplatesForRepository

清單

ListBranches

codecommit:ListBranches

清單

ListFileCommitHistory

codecommit:ListFileCommitHistory

清單

ListPullRequests

codecommit:ListPullRequests

清單

ListRepositories

codecommit:ListRepositories

清單

ListRepositoriesForApprovalRuleTemplate

codecommit:ListRepositoriesForApprovalRuleTemplate

清單

ListTagsForResource

codecommit:ListTagsForResource

清單

MergeBranchesByFastForward

codecommit:MergeBranchesByFastForward

寫入

MergeBranchesBySquash

codecommit:MergeBranchesBySquash

寫入

MergeBranchesByThreeWay

codecommit:MergeBranchesByThreeWay

寫入

MergePullRequestByFastForward

codecommit:MergePullRequestByFastForward

寫入

MergePullRequestBySquash

codecommit:MergePullRequestBySquash

寫入

MergePullRequestByThreeWay

codecommit:MergePullRequestByThreeWay

寫入

OverridePullRequestApprovalRules

codecommit:OverridePullRequestApprovalRules

寫入

PostCommentForComparedCommit

codecommit:PostCommentForComparedCommit

寫入

PostCommentForPullRequest

codecommit:PostCommentForPullRequest

寫入

PostCommentReply

codecommit:PostCommentReply

寫入

PutCommentReaction

codecommit:PutCommentReaction

寫入

PutFile

codecommit:PutFile

寫入

PutRepositoryTriggers

codecommit:PutRepositoryTriggers

寫入

TagResource

codecommit:TagResource

標記、寫入

TestRepositoryTriggers

codecommit:TestRepositoryTriggers

寫入

UntagResource

codecommit:UntagResource

標記、寫入

UpdateApprovalRuleTemplateContent

codecommit:UpdateApprovalRuleTemplateContent

寫入

UpdateApprovalRuleTemplateDescription

codecommit:UpdateApprovalRuleTemplateDescription

寫入

UpdateApprovalRuleTemplateName

codecommit:UpdateApprovalRuleTemplateName

寫入

UpdateComment

codecommit:UpdateComment

寫入

UpdateDefaultBranch

codecommit:UpdateDefaultBranch

寫入

UpdatePullRequestApprovalRuleContent

codecommit:UpdatePullRequestApprovalRuleContent

寫入

UpdatePullRequestApprovalState

codecommit:UpdatePullRequestApprovalState

寫入

UpdatePullRequestDescription

codecommit:UpdatePullRequestDescription

寫入

UpdatePullRequestStatus

codecommit:UpdatePullRequestStatus

寫入

UpdatePullRequestTitle

codecommit:UpdatePullRequestTitle

寫入

UpdateRepositoryDescription

codecommit:UpdateRepositoryDescription

寫入

UpdateRepositoryEncryptionKey

codecommit:UpdateRepositoryEncryptionKey

寫入

UpdateRepositoryName

codecommit:TagResource

標記、寫入

codecommit:UpdateRepositoryName

寫入

AWS CodeCommit 定義的動作

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

動作 說明 資源類型 (*必填項目) 條件索引鍵 存取層級

AssociateApprovalRuleTemplateWithRepository

准許建立核准規則範本與儲存器的關聯

儲存庫*

aws:ResourceTag/${TagKey}

寫入

BatchAssociateApprovalRuleTemplateWithRepositories

准許使用單一操作建立核准規則範本與多個儲存器的關聯

儲存庫*

aws:ResourceTag/${TagKey}

寫入

BatchDescribeMergeConflicts

在嘗試使用三向合併或壓縮合併選項來合併兩個遞交時,准許取得多次合併衝突的相關資訊

儲存庫*

aws:ResourceTag/${TagKey}

讀取

BatchDisassociateApprovalRuleTemplateFromRepositories

准許使用單一操作移除核准規則範本與多個儲存器的關聯

儲存庫*

aws:ResourceTag/${TagKey}

寫入

BatchGetCommits

准許傳回 AWS CodeCommit 儲存庫中一或多個遞交的相關資訊

儲存庫*

aws:ResourceTag/${TagKey}

讀取

BatchGetRepositories

准許取得多個儲存庫的相關資訊

儲存庫*

aws:ResourceTag/${TagKey}

讀取

CreateApprovalRuleTemplate

准許建立符合後列條件的核准規則範本:此範本會在符合範本定義條件的提取請求中自動建立核准規則;但不准許建立個別提取請求的核准規則

寫入

CreateBranch

准許使用此 API 在 AWS CodeCommit 儲存庫中建立分支; 不會控制 Git 建立分支動作

儲存庫*

aws:ResourceTag/${TagKey}

codecommit:References

寫入

CreateCommit

准許在 AWS CodeCommit 儲存庫的分支中新增、複製、移動或更新一或多個檔案,並為指定的分支中的變更產生遞交

儲存庫*

aws:ResourceTag/${TagKey}

codecommit:References

寫入

CreatePullRequest

准許在指定的儲存庫建立提取請求

儲存庫*

aws:ResourceTag/${TagKey}

寫入

CreatePullRequestApprovalRule

准許建立個別提取請求專屬的核准規則;但不准許建立核准規則範本

儲存庫*

aws:ResourceTag/${TagKey}

寫入

CreateRepository

准許建立 AWS CodeCommit 儲存庫

儲存庫*

aws:RequestTag/${TagKey}

aws:ResourceTag/${TagKey}

aws:TagKeys

寫入

CreateUnreferencedMergeCommit

准許建立未參考的遞交,其中包含使用三向或壓縮合併選項來合併兩個遞交的結果;不控制 Git 合併動作

儲存庫*

aws:ResourceTag/${TagKey}

codecommit:References

寫入

DeleteApprovalRuleTemplate

准許刪除核准規則範本

寫入

DeleteBranch

准許使用此 API 刪除 AWS CodeCommit 儲存庫中的分支; 不會控制 Git 刪除分支動作

儲存庫*

aws:ResourceTag/${TagKey}

codecommit:References

寫入

DeleteCommentContent

針對儲存庫中的變更、檔案或遞交所做的註解,准許刪除註解的內容

儲存庫*

aws:ResourceTag/${TagKey}

寫入

DeleteFile

准許從指定的分支刪除指定的檔案

儲存庫*

aws:ResourceTag/${TagKey}

codecommit:References

寫入

DeletePullRequestApprovalRule

准許刪除針對提取請求建立的核准規則 (如果該規則不是由核准規則範本所建立)

儲存庫*

aws:ResourceTag/${TagKey}

寫入

DeleteRepository

准許刪除 AWS CodeCommit 儲存庫

儲存庫*

aws:ResourceTag/${TagKey}

寫入

DescribeMergeConflicts

在嘗試使用三向或壓縮合併選項來合併兩個遞交時,准許取得特定合併衝突的相關資訊

儲存庫*

aws:ResourceTag/${TagKey}

讀取

DescribePullRequestEvents

准許傳回一或多個提取請求事件的相關資訊

儲存庫*

aws:ResourceTag/${TagKey}

讀取

DisassociateApprovalRuleTemplateFromRepository

准許移除核准規則範本與儲存器的關聯性

儲存庫*

aws:ResourceTag/${TagKey}

寫入

EvaluatePullRequestApprovalRules

准許評估提取請求是否可合併,評判基礎為其目前的核准狀態與核准規則需求

儲存庫*

aws:ResourceTag/${TagKey}

讀取

GetApprovalRuleTemplate

准許傳回核准規則範本的資訊

讀取

GetBlob

准許從 AWS CodeCommit AWS CodeCommit 主控台檢視 CodeCommit 儲存庫中個別檔案的編碼內容

儲存庫*

aws:ResourceTag/${TagKey}

讀取

GetBranch

准許使用此 API 取得 AWS CodeCommit 儲存庫中分支的詳細資訊; 不會控制 Git 分支動作

儲存庫*

aws:ResourceTag/${TagKey}

讀取

GetComment

針對儲存庫中的變更、檔案或遞交所做的註解,准許取得註解的內容

儲存庫*

aws:ResourceTag/${TagKey}

讀取

GetCommentReactions

准許取得註解的反應

儲存庫*

aws:ResourceTag/${TagKey}

讀取

GetCommentsForComparedCommit

針對比較兩個遞交而做的註解,准許取得註解的相關資訊

儲存庫*

aws:ResourceTag/${TagKey}

讀取

GetCommentsForPullRequest

准許取得對提取請求所做的註解

儲存庫*

aws:ResourceTag/${TagKey}

讀取

GetCommit

准許使用此 API 傳回遞交的相關資訊,包括遞交訊息和遞交者資訊;不控制 Git 日誌動作

儲存庫*

aws:ResourceTag/${TagKey}

讀取

GetDifferences

准許檢視有效遞交指標 (例如,分支、標籤、HEAD、遞交 ID,或其他完整參考) 之間差異的相關資訊

儲存庫*

aws:ResourceTag/${TagKey}

讀取

GetFile

准許傳回特定檔案及其中繼資料的 base-64 編碼內容

儲存庫*

aws:ResourceTag/${TagKey}

讀取

GetFolder

准許傳回儲存庫中特定資料夾的內容

儲存庫*

aws:ResourceTag/${TagKey}

讀取

GetMergeCommit

針對建立合併遞交的提取請求,准許取得以其中一個合併選項建立的合併遞交的相關資訊。並不是所有合併選項都會建立合併遞交。此許可不會控制 Git 合併動作

儲存庫*

aws:ResourceTag/${TagKey}

codecommit:References

讀取

GetMergeConflicts

針對儲存庫中的提取請求,准許取得遞交 ID 前後之間的合併衝突的相關資訊

儲存庫*

aws:ResourceTag/${TagKey}

讀取

GetMergeOptions

針對可用來合併兩個遞交的提取請求,准許取得合併選項的相關資訊;不控制 Git 合併動作

儲存庫*

aws:ResourceTag/${TagKey}

讀取

GetPullRequest

准許取得特定儲存庫中的提取請求的相關資訊

儲存庫*

aws:ResourceTag/${TagKey}

讀取

GetPullRequestApprovalStates

准許擷取已輸入提取請求目前的核准

儲存庫*

aws:ResourceTag/${TagKey}

讀取

GetPullRequestOverrideState

准許擷取指定提取請求目前的覆寫狀態

儲存庫*

aws:ResourceTag/${TagKey}

讀取

GetRepository

准許取得有關 AWS CodeCommit 儲存庫的資訊

儲存庫*

aws:ResourceTag/${TagKey}

讀取

GetRepositoryTriggers

准許取得儲存庫已設定的觸發的相關資訊

儲存庫*

aws:ResourceTag/${TagKey}

讀取

ListApprovalRuleTemplates

准許列出 AWS 區域 中 的所有核准規則範本 AWS 帳戶

清單

ListAssociatedApprovalRuleTemplatesForRepository

准許列出與儲存器相關聯的核准規則範本

儲存庫*

aws:ResourceTag/${TagKey}

清單

ListBranches

准許使用此 API 列出 AWS CodeCommit 儲存庫的分支; 不會控制 Git 分支動作

儲存庫*

aws:ResourceTag/${TagKey}

清單

ListFileCommitHistory

准許列出指定文件的遞交和變更

儲存庫*

aws:ResourceTag/${TagKey}

清單

ListPullRequests

准許列出特定儲存庫的提取請求

儲存庫*

aws:ResourceTag/${TagKey}

清單

ListRepositories

准許列出您 目前區域中 AWS CodeCommit 儲存庫的相關資訊 AWS 帳戶

清單

ListRepositoriesForApprovalRuleTemplate

准許列出與核准規則範本相關聯的儲存器

清單

ListTagsForResource

准許列出連接到 CodeCommit 資源 ARN 的資源

儲存庫

aws:ResourceTag/${TagKey}

清單

MergeBranchesByFastForward

准許使用向前快轉合併選項,將兩個遞交合併到指定的目的地分支

儲存庫*

aws:ResourceTag/${TagKey}

codecommit:References

寫入

MergeBranchesBySquash

准許使用壓縮合併選項,將兩個遞交合併到指定的目的地分支

儲存庫*

aws:ResourceTag/${TagKey}

codecommit:References

寫入

MergeBranchesByThreeWay

准許使用三向合併選項,將兩個遞交合併到指定的目的地分支

儲存庫*

aws:ResourceTag/${TagKey}

codecommit:References

寫入

MergePullRequestByFastForward

准許關閉提取請求,並在指定的遞交上嘗試使用向前快轉合併選項,合併到該提取請求指定的目的地分支

儲存庫*

aws:ResourceTag/${TagKey}

codecommit:References

寫入

MergePullRequestBySquash

准許關閉提取請求,並在指定的遞交上嘗試使用壓縮合併選項,合併到該提取請求指定的目的地分支

儲存庫*

aws:ResourceTag/${TagKey}

codecommit:References

寫入

MergePullRequestByThreeWay

准許關閉提取請求,並在指定的遞交上嘗試使用三向合併選項,合併到該提取請求指定的目的地分支

儲存庫*

aws:ResourceTag/${TagKey}

codecommit:References

寫入

OverridePullRequestApprovalRules

准許覆寫提取請求的所有核准規則,包括由範本建立的核准規則

儲存庫*

aws:ResourceTag/${TagKey}

寫入

PostCommentForComparedCommit

針對兩個遞交之間的比較,准許張貼註解

儲存庫*

aws:ResourceTag/${TagKey}

寫入

PostCommentForPullRequest

准許對提取請求張貼註解

儲存庫*

aws:ResourceTag/${TagKey}

寫入

PostCommentReply

針對遞交之間的比較或提取請求而做的註解,准許張貼註解以回覆

儲存庫*

aws:ResourceTag/${TagKey}

寫入

PutCommentReaction

准許張貼註解的反應

儲存庫*

aws:ResourceTag/${TagKey}

寫入

PutFile

准許在 AWS CodeCommit 儲存庫的分支中新增或更新檔案,並為指定分支中的新增產生遞交

儲存庫*

aws:ResourceTag/${TagKey}

codecommit:References

寫入

PutRepositoryTriggers

准許建立、更新或刪除儲存庫的觸發

儲存庫*

aws:ResourceTag/${TagKey}

寫入

TagResource

准許將資源標籤連接到 CodeCommit 資源 ARN

儲存庫

aws:RequestTag/${TagKey}

aws:ResourceTag/${TagKey}

aws:TagKeys

標記、寫入

TestRepositoryTriggers

准許將資訊傳送到觸發目標,以測試儲存庫觸發的功能

儲存庫*

aws:ResourceTag/${TagKey}

寫入

UntagResource

准許取消資源標籤與 CodeCommit 資源 ARN 的關聯

儲存庫

aws:ResourceTag/${TagKey}

aws:TagKeys

標記、寫入

UpdateApprovalRuleTemplateContent

准許更新核准規則範本的內容;但不准許更新專為提取請求建立之核准規則的內容

寫入

UpdateApprovalRuleTemplateDescription

准許更新核准規則範本的描述

寫入

UpdateApprovalRuleTemplateName

准許更新核准規則範本的名稱

寫入

UpdateComment

如果身分符合用來建立註解的身分,則准許更新註解的內容

儲存庫*

aws:ResourceTag/${TagKey}

寫入

UpdateDefaultBranch

准許變更 AWS CodeCommit 儲存庫中的預設分支

儲存庫*

aws:ResourceTag/${TagKey}

寫入

UpdatePullRequestApprovalRuleContent

准許更新針對特定提取請求建立之核准規則的內容;但不准許更新使用核准規則範本建立之規則的核准規則內容

儲存庫*

aws:ResourceTag/${TagKey}

寫入

UpdatePullRequestApprovalState

准許更新提取請求的核准狀態

儲存庫*

aws:ResourceTag/${TagKey}

寫入

UpdatePullRequestDescription

准許更新提取請求的描述

儲存庫*

aws:ResourceTag/${TagKey}

寫入

UpdatePullRequestStatus

准許更新提取請求的狀態

儲存庫*

aws:ResourceTag/${TagKey}

寫入

UpdatePullRequestTitle

准許更新提取請求的標題

儲存庫*

aws:ResourceTag/${TagKey}

寫入

UpdateRepositoryDescription

准許變更 AWS CodeCommit 儲存庫的描述

儲存庫*

aws:ResourceTag/${TagKey}

寫入

UpdateRepositoryEncryptionKey

准許變更用於加密和解密 AWS CodeCommit 儲存庫的 AWS KMS 加密金鑰

儲存庫*

aws:ResourceTag/${TagKey}

寫入

UpdateRepositoryName

准許變更 AWS CodeCommit 儲存庫的名稱

儲存庫*

aws:ResourceTag/${TagKey}

寫入

AWS CodeCommit 的僅限許可動作

下列動作是由 AWS CodeCommit 定義,但無法透過任何 API 操作直接叫用。它們只能用於 IAM 政策陳述式,以授予或拒絕許可。

動作 說明 資源類型 (*必填項目) 條件索引鍵 存取層級

BatchGetPullRequests

准許傳回 AWS CodeCommit 儲存庫中一或多個提取請求的相關資訊

儲存庫*

aws:ResourceTag/${TagKey}

讀取

CancelUploadArchive

准許取消將封存上傳至 AWS CodePipeline 中的管道

儲存庫*

aws:ResourceTag/${TagKey}

讀取

GetBlobDifferences

准許在 AWS CodeCommit 儲存庫中的兩個 Blob 版本之間運算結構化的線性差異

儲存庫*

aws:ResourceTag/${TagKey}

讀取

GetCommitHistory

准許取得儲存庫中的遞交歷史記錄的相關資訊

儲存庫*

aws:ResourceTag/${TagKey}

讀取

GetCommitsFromMergeBase

准許在潛在合併情況下取得遞交之間差異的相關資訊

儲存庫*

aws:ResourceTag/${TagKey}

讀取

GetObjectIdentifier

准許將 Blob、樹狀目錄和遞交解析為其識別符

儲存庫*

aws:ResourceTag/${TagKey}

讀取

GetReferences

准許取得 AWS CodeCommit 儲存庫中參考的詳細資訊; 不會控制 Git 參考動作

儲存庫*

aws:ResourceTag/${TagKey}

讀取

GetTree

准許從 AWS CodeCommit AWS CodeCommit 主控台檢視 CodeCommit 儲存庫中指定樹狀目錄的內容

儲存庫*

aws:ResourceTag/${TagKey}

讀取

GetUploadArchiveStatus

准許取得有關封存上傳至 AWS CodePipeline 中管道的狀態資訊

儲存庫*

aws:ResourceTag/${TagKey}

讀取

GitPull

准許將資訊從 AWS CodeCommit 儲存庫提取至本機儲存庫

儲存庫*

aws:ResourceTag/${TagKey}

讀取

GitPush

准許將資訊從本機儲存庫推送至 AWS CodeCommit 儲存庫

儲存庫*

aws:ResourceTag/${TagKey}

codecommit:References

寫入

UploadArchive

准許 AWS CodePipeline 的服務角色將儲存庫變更上傳至管道

儲存庫*

aws:ResourceTag/${TagKey}

寫入

AWS CodeCommit 定義的資源類型

此服務會定義下列資源類型,並可用在 IAM 許可政策陳述式的 Resource 元素中。

資源類型 ARN 條件索引鍵

儲存庫

arn:${Partition}:codecommit:${Region}:${Account}:${RepositoryName}

aws:ResourceTag/${TagKey}

AWS CodeCommit 的條件索引鍵

AWS CodeCommit 定義下列條件索引鍵,可用於 IAM 政策的 Condition元素。

條件索引鍵 描述 Type

aws:RequestTag/${TagKey}

依請求中的標籤鍵值對是否存在篩選存取權

String

aws:ResourceTag/${TagKey}

依連接到資源的標籤鍵值對篩選存取權

String

aws:TagKeys

依請求中是否存在標籤索引鍵來篩選存取

ArrayOfString

codecommit:References

依 Git 參考篩選對指定 AWS CodeCommit 動作的存取

String