AWS CodeBuild 权限参考
您可以在 AWS 策略中使用 AWS CodeBuild 范围的条件键来表示条件。有关列表,请参阅《IAM 用户指南》中的可用键。
请在策略的 Action 字段中指定这些操作。要指定操作,请在 API 操作名称之前使用 codebuild: 前缀(例如,codebuild:CreateProject 和 codebuild:StartBuild)。要在单个语句中指定多项操作,请使用逗号将它们隔开(例如,"Action": [
"codebuild:CreateProject", "codebuild:StartBuild" ])。
使用通配符
您可以在策略的 Resource 字段中指定带或不带通配符(*)的 ARN 作为资源值。您可以使用通配符指定多个操作或资源。例如,codebuild:* 指定所有 CodeBuild 操作,codebuild:Batch* 指定以单词 Batch 开头的所有 CodeBuild 操作。以下示例授予对以 my 名称开头的所有构建项目的访问权限:
arn:aws:codebuild:us-east-2:123456789012:project/my*CodeBuild API 操作和必需的操作权限
- BatchDeleteBuilds
-
操作:
codebuild:BatchDeleteBuilds删除构建所必需的。
资源:
arn:aws:codebuild:region-ID:account-ID:project/project-name - BatchGetBuilds
-
操作:
codebuild:BatchGetBuilds获取有关构建项目的信息所必需的。
资源:
arn:aws:codebuild:region-ID:account-ID:project/project-name - BatchGetProjects
-
操作:
codebuild:BatchGetProjects获取有关构建项目的信息所必需的。
资源:
arn:aws:codebuild:region-ID:account-ID:project/project-name - BatchGetReportGroups
-
操作:
codebuild:BatchGetReportGroups获取有关报告组的信息所必需的。
资源:
arn:aws:codebuild:region-ID:account-ID:report-group/report-group-name - BatchGetReports
-
操作:
codebuild:BatchGetReports获取有关报告的信息所必需的。
资源:
arn:aws:codebuild:region-ID:account-ID:report-group/report-group-name - BatchPutTestCases ¹
-
操作:
codebuild:BatchPutTestCases创建或更新测试报告所必需的。
资源:
arn:aws:codebuild:region-ID:account-ID:report-group/report-group-name - CreateProject
-
操作:、
codebuild:CreateProjectiam:PassRole创建构建项目所必需的。
资源。
-
arn:aws:codebuild:region-ID:account-ID:project/project-name -
arn:aws:iam::account-ID:role/role-name
-
- CreateReport ¹
-
操作:
codebuild:CreateReport创建测试报告所必需的。
资源:
arn:aws:codebuild:region-ID:account-ID:report-group/report-group-name - CreateReportGroup
-
操作:
codebuild:CreateReportGroup创建报告组所必需的。
资源:
arn:aws:codebuild:region-ID:account-ID:report-group/report-group-name - CreateWebhook
-
操作:
codebuild:CreateWebhook创建 Webhook 所必需的。
资源:
arn:aws:codebuild:region-ID:account-ID:project/project-name - DeleteProject
-
操作:
codebuild:DeleteProject删除 CodeBuild 项目所必需的。
资源:
arn:aws:codebuild:region-ID:account-ID:project/project-name - DeleteReport
-
操作:
codebuild:DeleteReport删除报告所必需的。
资源:
arn:aws:codebuild:region-ID:account-ID:report-group/report-group-name - DeleteReportGroup
-
操作:
codebuild:DeleteReportGroup删除报告组所必需的。
资源:
arn:aws:codebuild:region-ID:account-ID:report-group/report-group-name - DeleteSourceCredentials
-
操作:
codebuild:DeleteSourceCredentials要求删除一组
SourceCredentialsInfo对象,其中包含有关 GitHub、GitHub Enterprise Server 或 Bitbucket 存储库的凭证的信息。资源:
* - DeleteWebhook
-
操作:
codebuild:DeleteWebhook创建 Webhook 所必需的。
资源:
arn:aws:codebuild:region-ID:account-ID:project/project-name - DescribeTestCases
-
操作:
codebuild:DescribeTestCases返回测试用例的分页列表所必需的。
资源:
arn:aws:codebuild:region-ID:account-ID:report-group/report-group-name - ImportSourceCredentials
-
操作:
codebuild:ImportSourceCredentials要求导入一组
SourceCredentialsInfo对象,其中包含有关 GitHub、GitHub Enterprise Server 或 Bitbucket 存储库的凭证的信息。资源:
* - InvalidateProjectCache
-
操作:
codebuild:InvalidateProjectCache重置项目缓存所必需的。
资源:
arn:aws:codebuild:region-ID:account-ID:project/project-name - ListBuildBatches
-
操作:
codebuild:ListBuildBatches获取构建批处理 ID 的列表所必需的。
资源:
* - ListBuildBatchesForProject
-
操作:
codebuild:ListBuildBatchesForProject获取特定项目的构建批处理 ID 列表所必需的。
资源:
arn:aws:codebuild:region-ID:account-ID:project/project-name - ListBuilds
-
操作:
codebuild:ListBuilds获取构建 ID 的列表所必需的。
资源:
* - ListBuildsForProject
-
操作:
codebuild:ListBuildsForProject获取构建项目的构建 ID 列表所必需的。
资源:
arn:aws:codebuild:region-ID:account-ID:project/project-name - ListCuratedEnvironmentImages
-
操作:
codebuild:ListCuratedEnvironmentImages获取由 AWS CodeBuild 管理的所有 Docker 映像的相关信息所必需的。
资源:
*(必需,但不引用可寻址的 AWS 资源) - ListProjects
-
操作:
codebuild:ListProjects获取构建项目名称的列表所必需的。
资源:
* - ListReportGroups
-
操作:
codebuild:ListReportGroups获取报告组列表所必需的。
资源:
* - ListReports
-
操作:
codebuild:ListReports获取报告列表所必需的。
资源:
* - ListReportsForReportGroup
-
操作:
codebuild:ListReportsForReportGroup获取报告组的报告列表所必需的。
资源:
arn:aws:codebuild:region-ID:account-ID:report-group/report-group-name - RetryBuild
-
操作:
codebuild:RetryBuild重试构建所必需的。
资源:
arn:aws:codebuild:region-ID:account-ID:project/project-name - StartBuild
-
操作:
codebuild:StartBuild开始运行构建项目所必需的。
资源:
arn:aws:codebuild:region-ID:account-ID:project/project-name - StopBuild
-
操作:
codebuild:StopBuild尝试停止运行中构建项目所必需的。
资源:
arn:aws:codebuild:region-ID:account-ID:project/project-name - UpdateProject
-
操作:、
codebuild:UpdateProjectiam:PassRole更改构建项目的相关信息所必需的。
资源。
-
arn:aws:codebuild:region-ID:account-ID:project/project-name -
arn:aws:iam::account-ID:role/role-name
-
- UpdateProjectVisibility
-
操作:、
codebuild:UpdateProjectVisibilityiam:PassRole更改项目构建的公共可见性所必需的。
资源。
-
arn:aws:codebuild:region-ID:account-ID:project/project-name -
arn:aws:iam::account-ID:role/role-name
-
- UpdateReport ¹
-
操作:
codebuild:UpdateReport创建或更新测试报告所必需的。
资源:
arn:aws:codebuild:region-ID:account-ID:report-group/report-group-name - UpdateReportGroup
-
操作:
codebuild:UpdateReportGroup更新报告组所必需的。
资源:
arn:aws:codebuild:region-ID:account-ID:report-group/report-group-name - UpdateWebhook
-
操作:
codebuild:UpdateWebhook更新 Webhook 所必需的。
资源:
arn:aws:codebuild:region-ID:account-ID:project/project-name
¹ 仅用于权限。对于此操作没有 API。