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

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

CLI로 DeleteNetworkInterface 사용

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

CLI
AWS CLI

네트워크 인터페이스 삭제

이 예시에서는 지정된 네트워크 인터페이스를 삭제합니다. 이 명령이 성공하면 출력이 반환되지 않습니다.

명령:

aws ec2 delete-network-interface --network-interface-id eni-e5aa89a3
PowerShell
Tools for PowerShell V4

예제 1: 이 예제에서는 지정된 네트워크 인터페이스를 삭제합니다. Force 파라미터를 함께 지정하지 않는 한 작업이 진행되기 전에 확인 프롬프트가 표시됩니다.

Remove-EC2NetworkInterface -NetworkInterfaceId eni-12345678

출력:

Confirm Are you sure you want to perform this action? Performing operation "Remove-EC2NetworkInterface (DeleteNetworkInterface)" on Target "eni-12345678". [Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"):
  • API 세부 정보는 AWS Tools for PowerShell Cmdlet 참조(V4)DeleteNetworkInterface를 참조하세요.

Tools for PowerShell V5

예제 1: 이 예제에서는 지정된 네트워크 인터페이스를 삭제합니다. Force 파라미터를 함께 지정하지 않는 한 작업이 진행되기 전에 확인 프롬프트가 표시됩니다.

Remove-EC2NetworkInterface -NetworkInterfaceId eni-12345678

출력:

Confirm Are you sure you want to perform this action? Performing operation "Remove-EC2NetworkInterface (DeleteNetworkInterface)" on Target "eni-12345678". [Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"):
  • API 세부 정보는 AWS Tools for PowerShell Cmdlet 참조(V5)DeleteNetworkInterface를 참조하세요.