AWS Run

AWS Run

Certified
Enterprise Edition

Run a job on AWS Batch

Submits a job to an AWS Batch job queue and waits for it to complete.

yaml
type: io.kestra.plugin.ee.aws.batch.Run

Run an existing AWS Batch job definition on an existing queue (pure orchestration)

yaml
id: aws_batch_run_existing_job
namespace: company.team

description: >
  Orchestrate an existing AWS Batch job definition on an existing job queue (pure orchestration).
  No resource creation / modification / deletion.

inputs:
  - id: aws_region
    type: STRING
    defaults: eu-central-1
  - id: job_queue_arn
    type: STRING
    defaults: arn:aws:batch:eu-central-1:123456789012:job-queue/prod-etl-queue
  - id: job_definition_arn
    type: STRING
    defaults: arn:aws:batch:eu-central-1:123456789012:job-definition/prod-etl:42

tasks:
  - id: run_batch_job
    type: io.kestra.plugin.ee.aws.batch.Run
    region: "{{ inputs.aws_region }}"
    jobQueue: "{{ inputs.job_queue_arn }}"
    jobDefinition: "{{ inputs.job_definition_arn }}"
    jobName: "prod-etl-{{ execution.id }}"
    parameters:
      run_id: "{{ execution.id }}"
      environment: "prod"
    containerEnvironment:
      KESTRA_EXECUTION_ID: "{{ execution.id }}"
    wait: true
    completionCheckInterval: PT10S
    completionCheckMaxInterval: PT1M
    completionCheckBackoffMultiplier: 1.5
    maxWait: PT2H
    failOnFailedStatus: true
    streamLogs: true
    logGroupName: /aws/batch/job
    logStreamPrefix: "prod-etl-"
Properties

AWS Batch job definition

Name or ARN (optionally with revision) of the existing AWS Batch job definition.

AWS Batch job queue

Name or ARN of the existing AWS Batch job queue where the job will be submitted.

AWS region

AWS region where the Batch job will be submitted (for example: eu-central-1).

AWS access key ID

AWS access key ID used for authentication. If not set, the default AWS credentials provider chain is used.

Default1.5

Completion check backoff multiplier

Backoff multiplier applied after each completion check (must be greater than or equal to 1).

DefaultPT10S

Completion check interval

Initial polling interval used to check the job status when waiting for completion.

DefaultPT1M

Maximum completion check interval

Upper bound for adaptive polling interval while waiting for completion.

SubTypestring

Container command override

Optional container command override applied through AWS Batch containerOverrides.command.

Container environment overrides

Optional environment variables applied through AWS Batch containerOverrides.environment.

AWS endpoint override

Optional custom endpoint for AWS Batch (useful for testing or private endpoints).

Defaulttrue

Fail on FAILED job status

Whether the task should fail if the AWS Batch job ends with status FAILED.

AWS Batch job name

Optional name for the submitted job. Defaults to a name derived from the Kestra execution ID.

Default/aws/batch/job

CloudWatch log group name

CloudWatch Logs group used for live tailing when streamLogs is enabled.

CloudWatch log stream prefix

CloudWatch Logs stream prefix used for live tailing when streamLogs is enabled. Defaults to jobName.

DefaultPT6H

Maximum wait duration

Maximum amount of time to wait for the AWS Batch job to reach a terminal state.

AWS Batch job parameters

Key-value parameters passed to the job, overriding defaults defined in the job definition.

Reference (ref) of the pluginDefaults to apply to this task.

AWS secret access key

AWS secret access key used for authentication. If not set, the default AWS credentials provider chain is used.

AWS session token

Optional AWS session token for temporary credentials.

Defaultfalse

Stream CloudWatch logs

Whether to stream CloudWatch logs while waiting for completion. Log tailing starts only when wait=true and streamLogs=true. Best effort: failures in log streaming do not fail the task.

AWS STS endpoint override

Optional custom endpoint for AWS STS.

AWS STS role ARN

ARN of the AWS IAM role to assume using STS.

AWS STS external ID

External ID used when assuming a role in another AWS account.

AWS STS session duration

Duration of the assumed role session (default: PT15M).

AWS STS session name

Session name used when assuming an AWS STS role.

Defaulttrue

Wait for job completion

Whether the task should wait for the AWS Batch job to complete before finishing.

Job creation time

Timestamp (epoch milliseconds) when the AWS Batch job was created.

AWS Batch job definition

Name or ARN (with revision) of the AWS Batch job definition used to run the job.

AWS Batch job ID

Unique identifier assigned by AWS Batch to the submitted job.

AWS Batch job name

Name of the AWS Batch job as submitted by the task.

AWS Batch job queue

Name or ARN of the AWS Batch job queue on which the job was submitted.

Job start time

Timestamp (epoch milliseconds) when the AWS Batch job started running.

Job status

Final or current status of the AWS Batch job (for example: SUBMITTED, RUNNING, SUCCEEDED, FAILED).

Job status reason

Additional information explaining the job status, as reported by AWS Batch.

Job stop time

Timestamp (epoch milliseconds) when the AWS Batch job reached a terminal state.