AWS 文档 SDK 示例
将 SuspendProcesses 与 CLI 配合使用
以下代码示例演示如何使用 SuspendProcesses。
- CLI
-
- AWS CLI
-
暂停自动扩缩流程
此示例暂停指定自动扩缩组的指定扩展流程。
aws autoscaling suspend-processes \ --auto-scaling-group-namemy-asg\ --scaling-processesAlarmNotification此命令不生成任何输出。
有关更多信息,请参阅《Amazon EC2 Auto Scaling 用户指南》中的暂停和恢复扩展流程。
-
有关 API 详细信息,请参阅《AWS CLI 命令参考》中的 SuspendProcesses
。
-
- PowerShell
-
- Tools for PowerShell V4
-
示例 1:此示例暂停了指定自动扩缩组的指定 Auto Scaling 进程。
Suspend-ASProcess -AutoScalingGroupName my-asg -ScalingProcess "AlarmNotification"示例 2:此示例暂停了指定自动扩缩组的所有 Auto Scaling 进程。
Suspend-ASProcess -AutoScalingGroupName my-asg-
有关 API 详细信息,请参阅《AWS Tools for PowerShell Cmdlet Reference (V4)》中的 SuspendProcesses。
-
- Tools for PowerShell V5
-
示例 1:此示例暂停了指定自动扩缩组的指定 Auto Scaling 进程。
Suspend-ASProcess -AutoScalingGroupName my-asg -ScalingProcess "AlarmNotification"示例 2:此示例暂停了指定自动扩缩组的所有 Auto Scaling 进程。
Suspend-ASProcess -AutoScalingGroupName my-asg-
有关 API 详细信息,请参阅《AWS Tools for PowerShell Cmdlet Reference (V5)》中的 SuspendProcesses。
-
SetInstanceProtection
TerminateInstanceInAutoScalingGroup