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

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

CLI로 DeleteInternetGateway 사용

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

작업 예시는 대규모 프로그램에서 발췌한 코드이며 컨텍스트에 맞춰 실행해야 합니다. 다음 코드 예제에서는 컨텍스트 내에서 이 작업을 확인할 수 있습니다.

CLI
AWS CLI

인터넷 게이트웨이 삭제

다음 delete-internet-gateway 예시에서는 지정된 인터넷 게이트웨이를 삭제합니다.

aws ec2 delete-internet-gateway \ --internet-gateway-id igw-0d0fb496b3EXAMPLE

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

자세한 내용은 Amazon VPC 사용 설명서인터넷 게이트웨이를 참조하세요.

PowerShell
Tools for PowerShell V4

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

Remove-EC2InternetGateway -InternetGatewayId igw-1a2b3c4d

출력:

Confirm Are you sure you want to perform this action? Performing operation "Remove-EC2InternetGateway (DeleteInternetGateway)" on Target "igw-1a2b3c4d". [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)DeleteInternetGateway를 참조하세요.

Tools for PowerShell V5

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

Remove-EC2InternetGateway -InternetGatewayId igw-1a2b3c4d

출력:

Confirm Are you sure you want to perform this action? Performing operation "Remove-EC2InternetGateway (DeleteInternetGateway)" on Target "igw-1a2b3c4d". [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)DeleteInternetGateway를 참조하세요.