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

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

CLI로 ExitStandby 사용

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

CLI
AWS CLI

인스턴스를 대기 모드에서 해제하려면

이 예제에서는 지정된 인스턴스를 대기 모드에서 해제합니다.

aws autoscaling exit-standby \ --instance-ids i-061c63c5eb45f0416 \ --auto-scaling-group-name my-asg

출력:

{ "Activities": [ { "ActivityId": "142928e1-a2dc-453a-9b24-b85ad6735928", "AutoScalingGroupName": "my-asg", "Description": "Moving EC2 instance out of Standby: i-061c63c5eb45f0416", "Cause": "At 2020-10-31T20:32:50Z instance i-061c63c5eb45f0416 was moved out of standby in response to a user request, increasing the capacity from 0 to 1.", "StartTime": "2020-10-31T20:32:50.222Z", "StatusCode": "PreInService", "Progress": 30, "Details": "{\"Subnet ID\":\"subnet-6194ea3b\",\"Availability Zone\":\"us-west-2c\"}" } ] }

자세한 내용은 https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-enter-exit-standby.htmlAmazon EC2 Auto Scaling 사용 설명서의 Auto Scaling 그룹에서 일시적으로 인스턴스 제거를 참조하세요.

  • API 세부 정보는 AWS CLI 명령 참조의 ExitStandby를 참조하세요.

PowerShell
Tools for PowerShell V4

예제 1: 이 예제에서는 지정된 인스턴스를 대기 모드에서 해제합니다.

Exit-ASStandby -InstanceId i-93633f9b -AutoScalingGroupName my-asg

출력:

ActivityId : 1833d3e8-e32f-454e-b731-0670ad4c6934 AutoScalingGroupName : my-asg Cause : At 2015-11-22T15:51:21Z instance i-95b8484f was moved out of standby in response to a user request, increasing the capacity from 1 to 2. Description : Moving EC2 instance out of Standby: i-95b8484f Details : {"Availability Zone":"us-west-2b","Subnet ID":"subnet-5264e837"} EndTime : Progress : 30 StartTime : 11/22/2015 7:51:21 AM StatusCode : PreInService StatusMessage :
  • API 세부 정보는 AWS Tools for PowerShell Cmdlet 참조(V4)ExitStandby를 참조하세요.

Tools for PowerShell V5

예제 1: 이 예제에서는 지정된 인스턴스를 대기 모드에서 해제합니다.

Exit-ASStandby -InstanceId i-93633f9b -AutoScalingGroupName my-asg

출력:

ActivityId : 1833d3e8-e32f-454e-b731-0670ad4c6934 AutoScalingGroupName : my-asg Cause : At 2015-11-22T15:51:21Z instance i-95b8484f was moved out of standby in response to a user request, increasing the capacity from 1 to 2. Description : Moving EC2 instance out of Standby: i-95b8484f Details : {"Availability Zone":"us-west-2b","Subnet ID":"subnet-5264e837"} EndTime : Progress : 30 StartTime : 11/22/2015 7:51:21 AM StatusCode : PreInService StatusMessage :
  • API 세부 정보는 AWS Tools for PowerShell Cmdlet 참조(V5)ExitStandby를 참조하세요.