選取您的 Cookie 偏好設定

我們使用提供自身網站和服務所需的基本 Cookie 和類似工具。我們使用效能 Cookie 收集匿名統計資料,以便了解客戶如何使用我們的網站並進行改進。基本 Cookie 無法停用,但可以按一下「自訂」或「拒絕」以拒絕效能 Cookie。

如果您同意,AWS 與經核准的第三方也會使用 Cookie 提供實用的網站功能、記住您的偏好設定,並顯示相關內容,包括相關廣告。若要接受或拒絕所有非必要 Cookie,請按一下「接受」或「拒絕」。若要進行更詳細的選擇,請按一下「自訂」。

使用 Step Functions 執行 AWS Batch 工作負載

焦點模式
使用 Step Functions 執行 AWS Batch 工作負載 - AWS Step Functions

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

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

您可以將 Step Functions 與 整合 AWS Batch ,以在 AWS 雲端中執行批次運算工作負載。此頁面列出支援的 AWS Batch APIs,並提供範例Task狀態來執行批次處理任務。

若要了解如何在 Step Functions 中整合 AWS 服務,請參閱 整合 服務在 Step Functions 中將參數傳遞至服務 API

Optimized AWS Batch Integration 的主要功能

請注意, 請求回應使用任務權杖等待回呼整合模式沒有最佳化。

下列包含提交 AWS Batch 任務並等待任務完成Task的狀態。

{ "StartAt": "BATCH_JOB", "States": { "BATCH_JOB": { "Type": "Task", "Resource": "arn:aws:states:::batch:submitJob.sync", "Parameters": { "JobDefinition": "preprocessing", "JobName": "PreprocessingBatchJob", "JobQueue": "SecondaryQueue", "Parameters.$": "$.batchjob.parameters", "ContainerOverrides": { "ResourceRequirements": [ { "Type": "VCPU", "Value": "4" } ] } }, "End": true } } }

AWS Batch APIs

中的參數Step Functions以 PascalCase 表示

即使原生服務 API 位於 camelCase 中,例如 API 動作 startSyncExecution,您可以在 PascalCase 中指定參數,例如:StateMachineArn

用於呼叫的 IAM 政策 AWS Batch

下列範例範本顯示 如何根據您狀態機器定義中的資源 AWS Step Functions 產生 IAM 政策。如需詳細資訊,請參閱 Step Functions 如何為整合服務產生 IAM 政策探索 Step Functions 中的服務整合模式

由於 AWS Batch 提供資源層級存取控制的部分支援,您必須使用 "Resource": "*"

Run a Job (.sync)
{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "batch:SubmitJob", "batch:DescribeJobs", "batch:TerminateJob" ], "Resource": "*" }, { "Effect": "Allow", "Action": [ "events:PutTargets", "events:PutRule", "events:DescribeRule" ], "Resource": [ "arn:aws:events:[[region]]:[[accountId]]:rule/StepFunctionsGetEventsForBatchJobsRule" ] } ] }
Request Response
{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "batch:SubmitJob" ], "Resource": "*" } ] }
{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "batch:SubmitJob", "batch:DescribeJobs", "batch:TerminateJob" ], "Resource": "*" }, { "Effect": "Allow", "Action": [ "events:PutTargets", "events:PutRule", "events:DescribeRule" ], "Resource": [ "arn:aws:events:[[region]]:[[accountId]]:rule/StepFunctionsGetEventsForBatchJobsRule" ] } ] }

在本頁面

下一個主題:

Amazon Bedrock

上一個主題:

Amazon Athena
隱私權網站條款Cookie 偏好設定
© 2025, Amazon Web Services, Inc.或其附屬公司。保留所有權利。