CLI로 CancelCapacityReservation 사용 - AWS SDK 코드 예제

AWS SDK 예제 GitHub 리포지토리에 더 많은 AWS문서 SDK 예제가 있습니다.

CLI로 CancelCapacityReservation 사용

다음 코드 예시는 CancelCapacityReservation의 사용 방법을 보여 줍니다.

CLI
AWS CLI

용량 예약 취소

다음 cancel-capacity-reservation 예시에서는 지정된 용량 예약을 취소합니다.

aws ec2 cancel-capacity-reservation \ --capacity-reservation-id cr-1234abcd56EXAMPLE

출력:

{ "Return": true }

자세한 내용은 Amazon EC2 사용 설명서용량 예약 취소를 참조하세요.

PowerShell
Tools for PowerShell V4

예제 1: 이 예제에서는 용량 예약 cr-0c1f2345db6f7cdba를 취소합니다.

Remove-EC2CapacityReservation -CapacityReservationId cr-0c1f2345db6f7cdba

출력:

Confirm Are you sure you want to perform this action? Performing the operation "Remove-EC2CapacityReservation (CancelCapacityReservation)" on target "cr-0c1f2345db6f7cdba". [Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"): y True
Tools for PowerShell V5

예제 1: 이 예제에서는 용량 예약 cr-0c1f2345db6f7cdba를 취소합니다.

Remove-EC2CapacityReservation -CapacityReservationId cr-0c1f2345db6f7cdba

출력:

Confirm Are you sure you want to perform this action? Performing the operation "Remove-EC2CapacityReservation (CancelCapacityReservation)" on target "cr-0c1f2345db6f7cdba". [Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"): y True