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

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

CLI로 DeleteLifecycleHook 사용

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

CLI
AWS CLI

수명 주기 후크를 삭제하는 방법

이 예제에서는 지정된 수명 주기 후크를 삭제합니다.

aws autoscaling delete-lifecycle-hook \ --lifecycle-hook-name my-lifecycle-hook \ --auto-scaling-group-name my-asg

이 명령은 출력을 생성하지 않습니다.

PowerShell
Tools for PowerShell V4

예제 1: 이 예제에서는 지정된 Auto Scaling 그룹에 대해 지정된 수명 주기 후크를 삭제합니다. 작업이 진행되기 전에 확인 메시지가 표시됩니다.

Remove-ASLifecycleHook -AutoScalingGroupName my-asg -LifecycleHookName myLifecycleHook

출력:

Confirm Are you sure you want to perform this action? Performing operation "Remove-ASLifecycleHook (DeleteLifecycleHook)" on Target "myLifecycleHook". [Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"):

예제 2: 강제 파라미터를 지정하면 작업이 진행되기 전에 확인 메시지가 표시되지 않습니다.

Remove-ASLifecycleHook -AutoScalingGroupName my-asg -LifecycleHookName myLifecycleHook -Force
  • API 세부 정보는 AWS Tools for PowerShell Cmdlet 참조(V4)DeleteLifecycleHook를 참조하세요.

Tools for PowerShell V5

예제 1: 이 예제에서는 지정된 Auto Scaling 그룹에 대해 지정된 수명 주기 후크를 삭제합니다. 작업이 진행되기 전에 확인 메시지가 표시됩니다.

Remove-ASLifecycleHook -AutoScalingGroupName my-asg -LifecycleHookName myLifecycleHook

출력:

Confirm Are you sure you want to perform this action? Performing operation "Remove-ASLifecycleHook (DeleteLifecycleHook)" on Target "myLifecycleHook". [Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"):

예제 2: 강제 파라미터를 지정하면 작업이 진행되기 전에 확인 메시지가 표시되지 않습니다.

Remove-ASLifecycleHook -AutoScalingGroupName my-asg -LifecycleHookName myLifecycleHook -Force
  • API 세부 정보는 AWS Tools for PowerShell Cmdlet 참조(V5)DeleteLifecycleHook를 참조하세요.