View a markdown version of this page

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

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

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

參考資料:

AWS Batch 定義的 API 操作

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

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

CancelJob

batch:CancelJob

寫入

CancelJobs

batch:CancelJob

寫入

CreateComputeEnvironment

batch:CreateComputeEnvironment

寫入

batch:SetCapacityTags

標記、寫入

batch:TagResource

標記、寫入

iam:PassRole

iam:PassedToService

batch.amazonaws.com、ec2.amazonaws.com、ecs.amazonaws.com、spotfleet.amazonaws.com

寫入

CreateConsumableResource

batch:CreateConsumableResource

寫入

batch:TagResource

標記、寫入

CreateJobQueue

batch:CreateJobQueue

寫入

batch:TagResource

標記、寫入

CreateQuotaShare

batch:CreateQuotaShare

寫入

batch:TagResource

標記、寫入

CreateSchedulingPolicy

batch:CreateSchedulingPolicy

寫入

batch:TagResource

標記、寫入

CreateServiceEnvironment

batch:CreateServiceEnvironment

寫入

batch:TagResource

標記、寫入

DeleteComputeEnvironment

batch:DeleteComputeEnvironment

寫入

DeleteConsumableResource

batch:DeleteConsumableResource

寫入

DeleteJobQueue

batch:DeleteJobQueue

寫入

DeleteQuotaShare

batch:DeleteQuotaShare

寫入

DeleteSchedulingPolicy

batch:DeleteSchedulingPolicy

寫入

DeleteServiceEnvironment

batch:DeleteServiceEnvironment

寫入

DeregisterJobDefinition

batch:DeregisterJobDefinition

寫入

DescribeComputeEnvironments

batch:DescribeComputeEnvironments

讀取

DescribeConsumableResource

batch:DescribeConsumableResource

讀取

DescribeJobDefinitions

batch:DescribeJobDefinitions

讀取

DescribeJobQueues

batch:DescribeJobQueues

讀取

DescribeJobs

batch:DescribeJobs

讀取

DescribeQuotaShare

batch:DescribeQuotaShare

讀取

DescribeSchedulingPolicies

batch:DescribeSchedulingPolicies

讀取

DescribeServiceEnvironments

batch:DescribeServiceEnvironments

讀取

DescribeServiceJob

batch:DescribeServiceJob

讀取

GetJobQueueSnapshot

batch:GetJobQueueSnapshot

讀取

ListConsumableResources

batch:ListConsumableResources

清單

ListJobs

batch:ListJobs

清單

ListJobsByConsumableResource

batch:ListJobsByConsumableResource

清單

ListQuotaShares

batch:ListQuotaShares

清單

ListSchedulingPolicies

batch:ListSchedulingPolicies

讀取

ListServiceJobs

batch:ListServiceJobs

清單

ListTagsForResource

batch:ListTagsForResource

讀取

RegisterJobDefinition

batch:RegisterJobDefinition

寫入

batch:TagResource

標記、寫入

iam:PassRole

iam:PassedToService

ecs-tasks.amazonaws.com

寫入

SubmitJob

batch:SubmitJob

寫入

batch:TagResource

標記、寫入

SubmitServiceJob

batch:SubmitServiceJob

寫入

batch:TagResource

標記、寫入

iam:PassRole

iam:PassedToService

sagemaker.amazonaws.com

寫入

TagResource

batch:TagResource

標記、寫入

TerminateJob

batch:TerminateJob

寫入

TerminateJobs

batch:TerminateJob

寫入

TerminateServiceJob

batch:TerminateServiceJob

寫入

TerminateServiceJobs

batch:TerminateServiceJob

寫入

UntagResource

batch:UntagResource

標記、寫入

UpdateComputeEnvironment

batch:SetCapacityTags

標記、寫入

batch:UpdateComputeEnvironment

寫入

iam:PassRole

iam:PassedToService

batch.amazonaws.com、ec2.amazonaws.com、ecs.amazonaws.com

寫入

UpdateConsumableResource

batch:UpdateConsumableResource

寫入

UpdateJobQueue

batch:UpdateJobQueue

寫入

UpdateQuotaShare

batch:UpdateQuotaShare

寫入

UpdateSchedulingPolicy

batch:UpdateSchedulingPolicy

寫入

UpdateServiceEnvironment

batch:UpdateServiceEnvironment

寫入

UpdateServiceJob

batch:UpdateServiceJob

寫入

AWS Batch 定義的動作

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

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

CancelJob

准許取消您帳戶中 AWS 批次任務佇列中的任務

任務*

aws:ResourceTag/${TagKey}

寫入

CreateComputeEnvironment

准許在您的帳戶中建立 AWS 批次運算環境

運算環境*

aws:RequestTag/${TagKey}

aws:ResourceTag/${TagKey}

aws:TagKeys

寫入

CreateConsumableResource

准許在您的帳戶中建立 AWS 批次消耗性資源

消耗性資源*

aws:RequestTag/${TagKey}

aws:ResourceTag/${TagKey}

aws:TagKeys

寫入

CreateJobQueue

准許在您的帳戶中建立 AWS 批次任務佇列

運算環境

aws:RequestTag/${TagKey}

aws:ResourceTag/${TagKey}

aws:TagKeys

寫入

job-queue*

aws:RequestTag/${TagKey}

aws:ResourceTag/${TagKey}

aws:TagKeys

scheduling-policy

aws:RequestTag/${TagKey}

aws:ResourceTag/${TagKey}

aws:TagKeys

服務環境

aws:RequestTag/${TagKey}

aws:ResourceTag/${TagKey}

aws:TagKeys

CreateQuotaShare

准許在您的帳戶中建立 AWS 批次配額共享

job-queue*

aws:RequestTag/${TagKey}

aws:ResourceTag/${TagKey}

aws:TagKeys

寫入

quota-share*

aws:RequestTag/${TagKey}

aws:ResourceTag/${TagKey}

aws:TagKeys

CreateSchedulingPolicy

准許在您的帳戶中建立 AWS 批次排程政策

scheduling-policy*

aws:RequestTag/${TagKey}

aws:ResourceTag/${TagKey}

aws:TagKeys

寫入

CreateServiceEnvironment

准許在您的帳戶中建立 AWS Batch 服務環境

服務環境*

aws:RequestTag/${TagKey}

aws:ResourceTag/${TagKey}

aws:TagKeys

寫入

DeleteComputeEnvironment

准許刪除您帳戶中的 AWS 批次運算環境

運算環境*

aws:ResourceTag/${TagKey}

寫入

DeleteConsumableResource

准許刪除您帳戶中的 AWS 批次消耗性資源

消耗性資源*

aws:ResourceTag/${TagKey}

寫入

DeleteJobQueue

准許刪除您帳戶中的 AWS 批次任務佇列

job-queue*

aws:ResourceTag/${TagKey}

寫入

DeleteQuotaShare

准許刪除您帳戶中的 AWS 批次配額共享

quota-share*

aws:ResourceTag/${TagKey}

寫入

DeleteSchedulingPolicy

准許刪除您帳戶中的 AWS 批次排程政策

scheduling-policy*

aws:ResourceTag/${TagKey}

寫入

DeleteServiceEnvironment

准許刪除您帳戶中的 AWS Batch 服務環境

服務環境*

aws:ResourceTag/${TagKey}

寫入

DeregisterJobDefinition

准許在您的帳戶中取消註冊 AWS Batch 任務定義

job-definition-revision*

aws:ResourceTag/${TagKey}

寫入

DescribeComputeEnvironments

准許描述您帳戶中的一或多個 AWS 批次運算環境

讀取

DescribeConsumableResource

准許描述您帳戶中的一或多個 AWS 批次消耗性資源

消耗性資源*

aws:ResourceTag/${TagKey}

讀取

DescribeJobDefinitions

准許描述您帳戶中的一或多個 AWS 批次任務定義

讀取

DescribeJobQueues

准許描述您帳戶中的一或多個 AWS 批次任務佇列

讀取

DescribeJobs

准許描述您帳戶中的 AWS 批次任務清單

讀取

DescribeQuotaShare

准許描述您帳戶中的 AWS 批次配額共享

quota-share*

aws:ResourceTag/${TagKey}

讀取

DescribeSchedulingPolicies

准許描述您帳戶中的一或多個 AWS 批次排程政策

讀取

DescribeServiceEnvironments

准許描述您帳戶中的一或多個 AWS Batch 服務環境

讀取

DescribeServiceJob

准許描述您帳戶中的 AWS Batch 服務任務

讀取

GetJobQueueSnapshot

准許取得您帳戶中 AWS 批次任務佇列的快照

job-queue*

aws:ResourceTag/${TagKey}

讀取

ListConsumableResources

准許列出您帳戶中的 AWS 批次消耗性資源

清單

ListJobs

准許列出您帳戶中指定 AWS 批次任務佇列的任務

清單

ListJobsByConsumableResource

准許列出需要帳戶中特定消耗性資源的 AWS 批次任務

消耗性資源*

aws:ResourceTag/${TagKey}

清單

ListQuotaShares

准許列出您帳戶中的 AWS 批次配額共享

job-queue*

aws:ResourceTag/${TagKey}

清單

ListSchedulingPolicies

准許列出您帳戶中的 AWS 批次排程政策

讀取

ListServiceJobs

准許列出您帳戶中指定 AWS 批次任務佇列的服務任務

清單

ListTagsForResource

准許列出您帳戶中 AWS 批次資源的標籤

運算環境

aws:ResourceTag/${TagKey}

讀取

消耗性資源

aws:ResourceTag/${TagKey}

任務

aws:ResourceTag/${TagKey}

job-definition-revision

aws:ResourceTag/${TagKey}

job-queue

aws:ResourceTag/${TagKey}

配額共用

aws:ResourceTag/${TagKey}

scheduling-policy

aws:ResourceTag/${TagKey}

服務環境

aws:ResourceTag/${TagKey}

service-job

aws:ResourceTag/${TagKey}

RegisterJobDefinition

准許在您的帳戶中註冊 AWS Batch 任務定義

消耗性資源

aws:RequestTag/${TagKey}

aws:ResourceTag/${TagKey}

aws:TagKeys

batch:AWSLogsCreateGroup

batch:AWSLogsGroup

batch:AWSLogsRegion

batch:AWSLogsStreamPrefix

batch:EKSImage

batch:EKSNamespace

batch:EKSPrivileged

batch:EKSRunAsGroup

batch:EKSRunAsUser

batch:EKSServiceAccountName

batch:Image

batch:LogDriver

batch:Privileged

batch:User

寫入

任務定義*

aws:RequestTag/${TagKey}

aws:ResourceTag/${TagKey}

aws:TagKeys

batch:AWSLogsCreateGroup

batch:AWSLogsGroup

batch:AWSLogsRegion

batch:AWSLogsStreamPrefix

batch:EKSImage

batch:EKSNamespace

batch:EKSPrivileged

batch:EKSRunAsGroup

batch:EKSRunAsUser

batch:EKSServiceAccountName

batch:Image

batch:LogDriver

batch:Privileged

批次:使用者

SubmitJob

准許從您帳戶中的任務定義提交 AWS Batch 任務

消耗性資源

aws:RequestTag/${TagKey}

aws:ResourceTag/${TagKey}

aws:TagKeys

寫入

任務*

aws:RequestTag/${TagKey}

aws:ResourceTag/${TagKey}

aws:TagKeys

batch:EKSImage

batch:EKSNamespace

batch:ShareIdentifier

任務定義

aws:RequestTag/${TagKey}

aws:TagKeys

job-definition-revision

aws:RequestTag/${TagKey}

aws:ResourceTag/${TagKey}

aws:TagKeys

job-queue*

aws:RequestTag/${TagKey}

aws:ResourceTag/${TagKey}

aws:TagKeys

SubmitServiceJob

准許提交 AWS Batch 服務任務

job-queue*

aws:RequestTag/${TagKey}

aws:ResourceTag/${TagKey}

aws:TagKeys

batch:SchedulingPriority

寫入

配額共用

aws:RequestTag/${TagKey}

aws:ResourceTag/${TagKey}

aws:TagKeys

batch:SchedulingPriority

service-job*

aws:RequestTag/${TagKey}

aws:ResourceTag/${TagKey}

aws:TagKeys

batch:SchedulingPriority

batch:ShareIdentifier

TagResource

准許標記您帳戶中的 AWS Batch 資源

運算環境

aws:RequestTag/${TagKey}

aws:ResourceTag/${TagKey}

aws:TagKeys

標記、寫入

消耗性資源

aws:RequestTag/${TagKey}

aws:ResourceTag/${TagKey}

aws:TagKeys

任務

aws:RequestTag/${TagKey}

aws:ResourceTag/${TagKey}

aws:TagKeys

job-definition-revision

aws:RequestTag/${TagKey}

aws:ResourceTag/${TagKey}

aws:TagKeys

job-queue

aws:RequestTag/${TagKey}

aws:ResourceTag/${TagKey}

aws:TagKeys

配額共用

aws:RequestTag/${TagKey}

aws:ResourceTag/${TagKey}

aws:TagKeys

scheduling-policy

aws:RequestTag/${TagKey}

aws:ResourceTag/${TagKey}

aws:TagKeys

服務環境

aws:RequestTag/${TagKey}

aws:ResourceTag/${TagKey}

aws:TagKeys

service-job

aws:RequestTag/${TagKey}

aws:ResourceTag/${TagKey}

aws:TagKeys

TerminateJob

准許終止您帳戶中 AWS 批次任務佇列中的任務

任務*

aws:ResourceTag/${TagKey}

寫入

TerminateServiceJob

准許終止您帳戶中 AWS 批次任務佇列中的服務任務

service-job*

aws:ResourceTag/${TagKey}

寫入

UntagResource

准許取消標記您帳戶中的 AWS Batch 資源

運算環境

aws:ResourceTag/${TagKey}

aws:TagKeys

標記、寫入

消耗性資源

aws:ResourceTag/${TagKey}

aws:TagKeys

任務

aws:ResourceTag/${TagKey}

aws:TagKeys

job-definition-revision

aws:ResourceTag/${TagKey}

aws:TagKeys

job-queue

aws:ResourceTag/${TagKey}

aws:TagKeys

配額共用

aws:ResourceTag/${TagKey}

aws:TagKeys

scheduling-policy

aws:ResourceTag/${TagKey}

aws:TagKeys

服務環境

aws:ResourceTag/${TagKey}

aws:TagKeys

service-job

aws:ResourceTag/${TagKey}

aws:TagKeys

UpdateComputeEnvironment

准許更新您帳戶中的 AWS 批次運算環境

運算環境*

aws:ResourceTag/${TagKey}

寫入

UpdateConsumableResource

准許更新您帳戶中的 AWS 批次消耗性資源

消耗性資源*

aws:ResourceTag/${TagKey}

寫入

UpdateJobQueue

准許更新您帳戶中的 AWS 批次任務佇列

運算環境

aws:ResourceTag/${TagKey}

寫入

job-queue*

aws:ResourceTag/${TagKey}

scheduling-policy

aws:ResourceTag/${TagKey}

UpdateQuotaShare

准許更新您帳戶中的 AWS 批次配額共享

quota-share*

aws:ResourceTag/${TagKey}

寫入

UpdateSchedulingPolicy

准許更新您帳戶中的 AWS 批次排程政策

scheduling-policy*

aws:ResourceTag/${TagKey}

寫入

UpdateServiceEnvironment

准許更新您帳戶中的 AWS Batch 服務環境

服務環境*

aws:ResourceTag/${TagKey}

寫入

UpdateServiceJob

准許更新您帳戶中 AWS 批次任務佇列中的服務任務

service-job*

aws:ResourceTag/${TagKey}

batch:SchedulingPriority

寫入

AWS Batch 的僅限許可動作

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

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

SetCapacityTags

准許在帳戶中的 AWS 批次運算環境中設定容量標籤

運算環境*

aws:RequestTag/${TagKey}

aws:ResourceTag/${TagKey}

aws:TagKeys

標記、寫入

AWS Batch 定義的資源類型

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

資源類型 ARN 條件索引鍵

運算環境

arn:${Partition}:batch:${Region}:${Account}:compute-environment/${ComputeEnvironmentName}

aws:ResourceTag/${TagKey}

消耗性資源

arn:${Partition}:batch:${Region}:${Account}:consumable-resource/${ConsumableResourceName}

aws:ResourceTag/${TagKey}

任務

arn:${Partition}:batch:${Region}:${Account}:job/${JobId}

aws:ResourceTag/${TagKey}

任務定義

arn:${Partition}:batch:${Region}:${Account}:job-definition/${JobDefinitionName}

job-definition-revision

arn:${Partition}:batch:${Region}:${Account}:job-definition/${JobDefinitionName}:${Revision}

aws:ResourceTag/${TagKey}

job-queue

arn:${Partition}:batch:${Region}:${Account}:job-queue/${JobQueueName}

aws:ResourceTag/${TagKey}

配額共用

arn:${Partition}:batch:${Region}:${Account}:job-queue/${JobQueueName}/quota-share/${QuotaShareName}

aws:ResourceTag/${TagKey}

scheduling-policy

arn:${Partition}:batch:${Region}:${Account}:scheduling-policy/${SchedulingPolicyName}

aws:ResourceTag/${TagKey}

服務環境

arn:${Partition}:batch:${Region}:${Account}:service-environment/${ServiceEnvironmentName}

aws:ResourceTag/${TagKey}

service-job

arn:${Partition}:batch:${Region}:${Account}:service-job/${JobId}

aws:ResourceTag/${TagKey}

AWS Batch 的條件索引鍵

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

條件索引鍵 描述 Type

aws:RequestTag/${TagKey}

依要求中傳遞的標籤來篩選存取權

String

aws:ResourceTag/${TagKey}

依與資源關聯的標籤來篩選存取權

String

aws:TagKeys

依要求中傳遞的標籤索引鍵來篩選存取權

ArrayOfString

batch:AWSLogsCreateGroup

依指定的日誌記錄驅動程式 (判斷是否會建立日誌的 awslogs 群組) 篩選存取權

Bool

batch:AWSLogsGroup

依日誌所在的 awslog 群組篩選存取權

String

batch:AWSLogsRegion

依日誌傳送到的區域篩選存取權

String

batch:AWSLogsStreamPrefix

依 awslog 日誌串流字首篩選存取權

String

batch:EKSImage

依用於在 Amazon EKS 任務中啟動容器的映像篩選存取權

String

batch:EKSNamespace

依用於執行 Amazon EKS 任務 Pod 的叢集命名空間篩選存取權

String

batch:EKSPrivileged

依指定的權限參數值 (判斷是否針對 Amazon EKS 任務授予提高的權限給主機容器執行個體 (與根使用者相似) 上的容器) 篩選存取權

Bool

batch:EKSRunAsGroup

依用於在 Amazon EKS 任務中啟動容器的指定群組數字 ID (gid) 篩選存取權

數值

batch:EKSRunAsUser

依用於在 Amazon EKS 任務中啟動容器的指定使用者數字 ID (uid) 篩選存取權

數值

batch:EKSServiceAccountName

依用來執行 Amazon EKS 任務 Pod 的服務帳戶名稱篩選存取權

String

batch:Image

依用於啟動容器的映像篩選存取權

String

batch:LogDriver

依用於容器的日誌驅動程式篩選存取權

String

batch:Privileged

依指定的權限參數值 (判斷是否授予提高的權限給主機容器執行個體 (與根使用者相似) 上的容器) 篩選存取權

Bool

batch:SchedulingPriority

依任務佇列中任務的排程優先順序篩選存取權

數值

batch:ShareIdentifier

依提交任務中使用的 shareIdentifier 篩選存取權

String

batch:User

依容器內使用的使用者名稱或數值 uid 篩選存取權

String