미래 날짜 Capacity Reservation의 상태 변화 모니터링하기
미래 날짜 Capacity Reservation의 상태 변화 모니터링하기 (Monitor state changes for future-dated Capacity Reservations)
미래 날짜 Capacity Reservation의 상태가 바뀌면 Amazon EC2가 Amazon EventBridge로 이벤트를 보내요.
출처: 문서
본문
다음은 이 이벤트의 예시예요. 이 예시에서 미래 날짜 Capacity Reservation이 scheduled 상태에 들어갔어요. detail-type 필드에 강조된 상태를 주목하세요.
{
"version":"0",
"id":"12345678-1234-1234-1234-123456789012",
"detail-type":"EC2 Capacity Reservation Scheduled",
"source":"aws.ec2",
"account":"123456789012",
"time":"yyyy-mm-ddThh:mm:ssZ",
"region":"us-east-1",
"resources":[
"arn:aws:ec2:us-east-1:123456789012:capacity-reservation/cr-1234567890abcdefg"
],
"detail":{
"capacity-reservation-id":"cr-1234567890abcdefg",
"state":"scheduled"
}
}
detail-type 필드의 가능한 값은 다음과 같아요.
ScheduledActiveDelayedUnsupportedFailedExpired
이 상태에 대한 자세한 내용은 "View the state of a Capacity Reservation"을 참고하세요. Amazon EventBridge 이벤트를 만들어 이러한 이벤트를 모니터링하고 발생 시 특정 작업을 트리거할 수 있어요.
모든 상태 변경 이벤트를 모니터링하는 규칙을 만들려면 다음 이벤트 패턴을 사용해요.
{
"source": ["aws.ec2"],
"detail-type": [{
"prefix": "EC2 Capacity Reservation"
}]
}
특정 상태 변경만 모니터링하는 규칙을 만들려면 다음 이벤트 패턴을 사용해요.
{
"source": ["aws.ec2"],
"detail-type": [{
"prefix": "EC2 Capacity Reservation state"
}]
}
예를 들어 다음 이벤트 패턴은 미래 날짜 Capacity Reservation이 active 상태에 들어갈 때 보내지는 이벤트를 모니터링해요.
{
"source": ["aws.ec2"],
"detail-type": [{
"prefix": "EC2 Capacity Reservation Active"
}]
}