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

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

CLI로 DescribeScheduledInstances 사용

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

CLI
AWS CLI

정기 인스턴스 설명

이 예시에서는 지정된 정기 인스턴스를 설명합니다.

명령:

aws ec2 describe-scheduled-instances --scheduled-instance-ids sci-1234-1234-1234-1234-123456789012

출력:

{ "ScheduledInstanceSet": [ { "AvailabilityZone": "us-west-2b", "ScheduledInstanceId": "sci-1234-1234-1234-1234-123456789012", "HourlyPrice": "0.095", "CreateDate": "2016-01-25T21:43:38.612Z", "Recurrence": { "OccurrenceDaySet": [ 1 ], "Interval": 1, "Frequency": "Weekly", "OccurrenceRelativeToEnd": false, "OccurrenceUnit": "" }, "Platform": "Linux/UNIX", "TermEndDate": "2017-01-31T09:00:00Z", "InstanceCount": 1, "SlotDurationInHours": 32, "TermStartDate": "2016-01-31T09:00:00Z", "NetworkPlatform": "EC2-VPC", "TotalScheduledInstanceHours": 1696, "NextSlotStartTime": "2016-01-31T09:00:00Z", "InstanceType": "c4.large" } ] }

이 예시에서는 모든 정기 인스턴스를 설명합니다.

명령:

aws ec2 describe-scheduled-instances
PowerShell
Tools for PowerShell V4

예제 1: 이 예제에서는 일정이 예약된 지정된 인스턴스를 설명합니다.

Get-EC2ScheduledInstance -ScheduledInstanceId sci-1234-1234-1234-1234-123456789012

출력:

AvailabilityZone : us-west-2b CreateDate : 1/25/2016 1:43:38 PM HourlyPrice : 0.095 InstanceCount : 1 InstanceType : c4.large NetworkPlatform : EC2-VPC NextSlotStartTime : 1/31/2016 1:00:00 AM Platform : Linux/UNIX PreviousSlotEndTime : Recurrence : Amazon.EC2.Model.ScheduledInstanceRecurrence ScheduledInstanceId : sci-1234-1234-1234-1234-123456789012 SlotDurationInHours : 32 TermEndDate : 1/31/2017 1:00:00 AM TermStartDate : 1/31/2016 1:00:00 AM TotalScheduledInstanceHours : 1696

예제 2: 이 예제에서는 일정이 예약된 모든 인스턴스를 설명합니다.

Get-EC2ScheduledInstance
Tools for PowerShell V5

예제 1: 이 예제에서는 일정이 예약된 지정된 인스턴스를 설명합니다.

Get-EC2ScheduledInstance -ScheduledInstanceId sci-1234-1234-1234-1234-123456789012

출력:

AvailabilityZone : us-west-2b CreateDate : 1/25/2016 1:43:38 PM HourlyPrice : 0.095 InstanceCount : 1 InstanceType : c4.large NetworkPlatform : EC2-VPC NextSlotStartTime : 1/31/2016 1:00:00 AM Platform : Linux/UNIX PreviousSlotEndTime : Recurrence : Amazon.EC2.Model.ScheduledInstanceRecurrence ScheduledInstanceId : sci-1234-1234-1234-1234-123456789012 SlotDurationInHours : 32 TermEndDate : 1/31/2017 1:00:00 AM TermStartDate : 1/31/2016 1:00:00 AM TotalScheduledInstanceHours : 1696

예제 2: 이 예제에서는 일정이 예약된 모든 인스턴스를 설명합니다.

Get-EC2ScheduledInstance