

기계 번역으로 제공되는 번역입니다. 제공된 번역과 원본 영어의 내용이 상충하는 경우에는 영어 버전이 우선합니다.

# AWS Batch 이벤트
<a name="batch_cwe_events"></a>

AWS Batch 는 작업 상태 변경 이벤트를 EventBridge로 전송합니다.는 작업 상태를 AWS Batch 추적합니다. 이전에 제출한 작업의 상태가 변경되면 이벤트가 간접적으로 호출됩니다. `RUNNING` 상태에 있던 작업이 `FAILED`로 이동하는 경우를 예로 들 수 있습니다. 이러한 이벤트는 작업 상태 변경 이벤트로 분류됩니다.

**참고**  
AWS Batch 는 향후 다른 이벤트 유형, 소스 및 세부 정보를 추가할 수 있습니다. 프로그래밍 방식으로 이벤트 JSON 데이터를 역직렬화하는 경우, 알 수 없는 속성을 처리할 수 있도록 애플리케이션이 준비되어야 합니다. 이는 이러한 추가 속성이 추가되는 경우 및 추가될 때 문제가 발생하지 않도록 하기 위한 것입니다.

# 작업 상태 변경 이벤트
<a name="batch_job_events"></a>

기존(이전에 제출한) 작업의 상태가 변경될 때마다 이벤트가 생성됩니다. AWS Batch 작업 상태에 대한 자세한 내용은 [작업 상태](job_states.md) 섹션을 참조하세요.

**참고**  
첫 작업 제출에 대한 이벤트는 생성되지 않습니다.

**Example 작업 상태 변경 이벤트**  
작업 상태 변경 이벤트는 다음 형식으로 제공됩니다. `detail` 섹션은 *AWS Batch API 참조*의 [DescribeJobs](https://docs.aws.amazon.com/batch/latest/APIReference/API_DescribeJobs.html) API 작업에서 반환되는 [JobDetail](https://docs.aws.amazon.com/batch/latest/APIReference/API_JobDetail.html) 객체와 유사합니다. EventBridge 파라미터에 대한 자세한 정보는 *Amazon EventBridge 사용 설명서*의 [이벤트 및 이벤트 패턴](https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-events.html)을 참조하세요.  

```
{
    "version": "0",
    "id": "c8f9c4b5-76e5-d76a-f980-7011e206042b",
    "detail-type": "Batch Job State Change",
    "source": "aws.batch",
    "account": "123456789012",
    "time": "2022-01-11T23:36:40Z",
    "region": "us-east-1",
    "resources": [
        "arn:aws:batch:us-east-1:123456789012:job/4c7599ae-0a82-49aa-ba5a-4727fcce14a8"
    ],
    "detail": {
        "jobArn": "arn:aws:batch:us-east-1:123456789012:job/4c7599ae-0a82-49aa-ba5a-4727fcce14a8",
        "jobName": "event-test",
        "jobId": "4c7599ae-0a82-49aa-ba5a-4727fcce14a8",
        "jobQueue": "arn:aws:batch:us-east-1:123456789012:job-queue/PexjEHappyPathCanary2JobQueue",
        "status": "RUNNABLE",
        "attempts": [],
        "createdAt": 1641944200058,
        "retryStrategy": {
            "attempts": 2,
            "evaluateOnExit": []
        },
        "dependsOn": [],
        "jobDefinition": "arn:aws:batch:us-east-1:123456789012:job-definition/first-run-job-definition:1",
        "parameters": {},
        "container": {
            "image": "137112412989.dkr.ecr.us-east-1.amazonaws.com/amazonlinux:latest",
            "command": [
                "sleep",
                "600"
            ],
            "volumes": [],
            "environment": [],
            "mountPoints": [],
            "ulimits": [],
            "networkInterfaces": [],
            "resourceRequirements": [
                {
                    "value": "2",
                    "type": "VCPU"
                }, {
                    "value": "256",
                    "type": "MEMORY"
                }
            ],
            "secrets": []
        },
        "propagateTags": false,
        "platformCapabilities": []
    }
}
```

# 작업 대기열 차단 이벤트
<a name="batch-job-queue-blocked-events"></a>

가 `RUNNABLE` 상태에서 작업을 AWS Batch 감지하여 대기열을 차단할 때마다 Amazon CloudWatch Events에 이벤트가 생성됩니다. 지원되는 차단된 대기열 원인에 대한 자세한 내용은 [`RUNNABLE` 상태에서 정체된 작업](job_stuck_in_runnable.md) 섹션을 참조하세요. [https://docs.aws.amazon.com/batch/latest/APIReference/API_DescribeJobs.html](https://docs.aws.amazon.com/batch/latest/APIReference/API_DescribeJobs.html) API 작업의 `statusReason` 필드에서도 동일한 이유를 사용할 수 있습니다.

**Example 작업 대기열 차단 이벤트**  
작업 대기열 차단 이벤트는 다음과 같은 형식으로 제공됩니다. `detail` 섹션은 *AWS Batch API 참조*의 [DescribeJobs](https://docs.aws.amazon.com/batch/latest/APIReference/API_DescribeJobs.html) API 작업에서 반환되는 [JobDetail](https://docs.aws.amazon.com/batch/latest/APIReference/API_JobDetail.html) 객체와 유사합니다. EventBridge 파라미터에 대한 자세한 정보는 *Amazon EventBridge 사용 설명서*의 [이벤트 및 이벤트 패턴](https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-events.html)을 참조하세요.  

```
{
    "version": "0",
    "id": "c8f9c4b5-76e5-d76a-f980-7011e206042b",
    "detail-type": "Batch Job Queue Blocked",
    "source": "aws.batch",
    "account": "123456789012",
    "time": "2022-01-11T23:36:40Z",
    "region": "us-east-1",
    "resources": [
        "arn:aws:batch:us-east-1:123456789012:job/4c7599ae-0a82-49aa-ba5a-4727fcce14a8",
        "arn:aws:batch:us-east-1:123456789012:job-queue/PexjEHappyPathCanary2JobQueue"
    ],
    "detail": {
        "jobArn": "arn:aws:batch:us-east-1:123456789012:job/4c7599ae-0a82-49aa-ba5a-4727fcce14a8",
        "jobName": "event-test",
        "jobId": "4c7599ae-0a82-49aa-ba5a-4727fcce14a8",
        "jobQueue": "arn:aws:batch:us-east-1:123456789012:job-queue/PexjEHappyPathCanary2JobQueue",
        "status": "RUNNABLE",
        "statusReason": "blocked-reason",
        "attempts": [],
        "createdAt": 1641944200058,
        "retryStrategy": {
            "attempts": 2,
            "evaluateOnExit": []
        },
        "dependsOn": [],
        "jobDefinition": "arn:aws:batch:us-east-1:123456789012:job-definition/first-run-job-definition:1",
        "parameters": {},
        "container": {
            "image": "137112412989.dkr.ecr.us-east-1.amazonaws.com/amazonlinux:latest",
            "command": [
                "sleep",
                "600"
            ],
            "volumes": [],
            "environment": [],
            "mountPoints": [],
            "ulimits": [],
            "networkInterfaces": [],
            "resourceRequirements": [
                {
                    "value": "2",
                    "type": "VCPU"
                }, {
                    "value": "256",
                    "type": "MEMORY"
                }
            ],
            "secrets": []
        },
        "propagateTags": false,
        "platformCapabilities": []
    }
}
```

# 서비스 작업 상태 변경 이벤트
<a name="service-job-events"></a>

기존 서비스 작업의 상태가 변경될 때마다 이벤트가 생성됩니다. 서비스 작업 상태에 대한 자세한 내용은 [AWS Batch 서비스 작업 상태를 SageMaker AI 상태로 매핑](service-job-status.md) 섹션을 참조하세요.

**참고**  
첫 작업 제출에 대한 이벤트는 생성되지 않습니다.

**Example 서비스 작업 상태 변경 이벤트**  
작업 상태 변경 이벤트는 다음 형식으로 제공됩니다. `detail` 섹션은 *AWS Batch API 레퍼런스*의 [DescribeServiceJob](https://docs.aws.amazon.com/batch/latest/APIReference/API_DescribeServiceJob.html) API 작업에서 반환되는 응답과 유사합니다. EventBridge 파라미터에 대한 자세한 정보는 *Amazon EventBridge 사용 설명서*의 [이벤트 및 이벤트 패턴](https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-events.html)을 참조하세요.  
`tags` 및 `serviceRequestPayload` 필드는 이벤트 `detail`에 포함되지 않습니다.

```
{
  "version": "0",
  "id": "c8f9c4b5-76e5-d76a-f980-7011e206042b",
  "detail-type": "Batch Service Job State Change",
  "source": "aws.batch",
  "account": "123456789012",
  "time": "2022-01-11T23:36:40Z",
  "region": "us-east-1",
  "resources": [
    "arn:aws:batch:us-east-1:123456789012:service-job/4c7599ae-0a82-49aa-ba5a-4727fcce14a8"
  ],
  "detail": {
    "attempts": [
      {
        "serviceResourceId": {
          "name": "TrainingJobArn",
          "value": "arn:aws:sagemaker:us-east-1:123456789012:training-job/AWSBatchmy-training-job88b610a69aa8380ca5b0a7aba3f81cb8"
        },
        "startedAt": 1641944300058,
        "stoppedAt": 1641944400058,
        "statusReason": "Received status from SageMaker: Training job completed"
      }
    ],
    "createdAt": 1641944200058,
    "jobArn": "arn:aws:batch:us-east-1:123456789012:service-job/4c7599ae-0a82-49aa-ba5a-4727fcce14a8",
    "jobId": "0bb17543-ece6-4480-b1a7-a556d344746b",
    "jobName": "event-test",
    "jobQueue": "arn:aws:batch:us-east-1:123456789012:job-queue/HappyPathJobQueue",
    "latestAttempt": {
      "serviceResourceId": {
        "name": "TrainingJobArn",
        "value": "arn:aws:sagemaker:us-east-1:123456789012:training-job/AWSBatchmy-training-job88b610a69aa8380ca5b0a7aba3f81cb8"
      }
    },
    "serviceJobType": "SAGEMAKER_TRAINING",
    "startedAt": 1641944300058,
    "status": "SUCCEEDED",
    "statusReason": "Received status from SageMaker: Training job completed",
    "stoppedAt": 1641944400058,
    "timeoutConfig": {
      "attemptDurationSeconds": 60
    }
  }
}
```

# 서비스 작업 대기열 차단 이벤트
<a name="batch-service-job-queue-blocked-events"></a>

가 차단된 대기열을 AWS Batch 감지하면 Amazon CloudWatch Events에 이벤트가 생성됩니다. 차단된 대기열의 사유는 [https://docs.aws.amazon.com/batch/latest/APIReference/API_DescribeServiceJob.html](https://docs.aws.amazon.com/batch/latest/APIReference/API_DescribeServiceJob.html) API 작업의 `statusReason` 필드에서 찾을 수 있습니다.

**Example 서비스 작업 대기열 차단 이벤트**  
서비스 작업 대기열 차단 이벤트는 다음과 같은 형식으로 제공됩니다. `detail` 섹션은 *AWS Batch API 레퍼런스*의 [DescribeServiceJob](https://docs.aws.amazon.com/batch/latest/APIReference/API_DescribeServiceJob.html) API 작업에서 반환되는 응답과 유사합니다. EventBridge 파라미터에 대한 자세한 정보는 *Amazon EventBridge 사용 설명서*의 [이벤트 및 이벤트 패턴](https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-events.html)을 참조하세요.  
`tags` 및 `serviceRequestPayload` 필드는 이벤트 `detail`에 포함되지 않습니다.

```
{
  "version": "0",
  "id": "c8f9c4b5-76e5-d76a-f980-7011e206042b",
  "detail-type": "Batch Service Job Queue Blocked",
  "source": "aws.batch",
  "account": "123456789012",
  "time": "2022-01-11T23:36:40Z",
  "region": "us-east-1",
  "resources": [
    "arn:aws:batch:us-east-1:123456789012:service-job/4c7599ae-0a82-49aa-ba5a-4727fcce14a8"
  ],
  "detail": {
    "attempts": [],
    "createdAt": 1641944200058,
    "jobArn": "arn:aws:batch:us-east-1:123456789012:service-job/4c7599ae-0a82-49aa-ba5a-4727fcce14a8",
    "jobId": "6271dfdf-d8a7-41b1-a4d2-55a2224f5375",
    "jobName": "event-test",
    "jobQueue": "arn:aws:batch:us-east-1:123456789012:job-queue/HappyPathJobQueue",
    "serviceJobType": "SAGEMAKER_TRAINING",
    "status": "RUNNABLE",
    "statusReason": "blocked-reason",
    "timeoutConfig": {
      "attemptDurationSeconds": 60
    }
  }
}
```

# 서비스 작업 선점 이벤트
<a name="batch-service-job-preemption-events"></a>

선점 이벤트는 선점 시퀀스가 시작되거나 완료될 때마다 게시됩니다. 시작된 이벤트는 대여된 용량을 회수하기 위해 선점이 처음 트리거될 때 생성됩니다. 선점 시퀀스가 완료되고 선점된 시도의 요약이 포함되면 완료된 이벤트가 생성됩니다.

**Example 서비스 작업 선점 시작 이벤트**  
서비스 작업 선점 시작 이벤트는 다음 형식으로 전달됩니다. EventBridge 파라미터에 대한 자세한 정보는 *Amazon EventBridge 사용 설명서*의 [이벤트 및 이벤트 패턴](https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-events.html)을 참조하세요.  

```
{
  "version": "0",
  "id": "1b4a511e-2737-226a-a1e7-fc97f1cd9681",
  "detail-type": "Batch Service Job Preemption Started",
  "source": "aws.batch",
  "account": "123456789012",
  "time": "2026-03-16T19:57:27Z",
  "region": "us-east-1",
  "resources": [
    "arn:aws:batch:us-east-1:123456789012:service-job/51f245a9-2995-4a53-bced-7b3c00028f84"
  ],
  "detail": {
    "statusReason": "PREEMPTION_IN_PROGRESS: Cross-share preemption triggered to reclaim borrowed capacity",
    "preemptedJobArn": "arn:aws:batch:us-east-1:123456789012:service-job/51f245a9-2995-4a53-bced-7b3c00028f84",
    "status": "RUNNING"
  }
}
```

**Example 서비스 작업 선점 완료 이벤트**  
서비스 작업 선점 완료 이벤트는 다음 형식으로 전달됩니다. `preemptionSummary` 필드에는 개수 및 가장 최근의 선점된 시도 정보를 포함하여 선점된 시도에 대한 세부 정보가 포함됩니다.  

```
{
  "version": "0",
  "id": "2b1c6151-c166-edf5-822c-211b3bfd46b2",
  "detail-type": "Batch Service Job Preemption Completed",
  "source": "aws.batch",
  "account": "123456789012",
  "time": "2026-03-16T19:57:47Z",
  "region": "us-east-1",
  "resources": [
    "arn:aws:batch:us-east-1:123456789012:service-job/51f245a9-2995-4a53-bced-7b3c00028f84"
  ],
  "detail": {
    "preemptedJobArn": "arn:aws:batch:us-east-1:123456789012:service-job/51f245a9-2995-4a53-bced-7b3c00028f84",
    "preemptionSummary": {
      "preemptedAttemptCount": 1,
      "recentPreemptedAttempts": [
        {
          "serviceResourceId": {
            "name": "TrainingJobArn",
            "value": "arn:aws:sagemaker:us-east-1:123456789012:training-job/AWSBatchqm-training-job9b2f08f911cf3dd794c1b3e72ae7ca5f"
          },
          "startedAt": 1773690923359,
          "stoppedAt": 1773691064669,
          "statusReason": "Cross-share preemption triggered to reclaim borrowed capacity"
        }
      ]
    },
    "status": "RUNNABLE"
  }
}
```