Ada lebih banyak contoh AWS SDK yang tersedia di repo Contoh SDK AWS Doc
Terjemahan disediakan oleh mesin penerjemah. Jika konten terjemahan yang diberikan bertentangan dengan versi bahasa Inggris aslinya, utamakan versi bahasa Inggris.
Gunakan DeleteVpnGateway
dengan CLI
Contoh kode berikut menunjukkan cara menggunakanDeleteVpnGateway
.
- CLI
-
- AWS CLI
-
Untuk menghapus gateway pribadi virtual
Contoh ini menghapus gateway pribadi virtual yang ditentukan. Jika perintah berhasil, tidak ada output yang akan ditampilkan.
Perintah:
aws ec2 delete-vpn-gateway --vpn-gateway-id
vgw-9a4cacf3
-
Untuk detail API, lihat DeleteVpnGateway
di Referensi AWS CLI Perintah.
-
- PowerShell
-
- Alat untuk PowerShell V4
-
Contoh 1: Contoh ini menghapus gateway pribadi virtual yang ditentukan. Anda diminta untuk konfirmasi sebelum operasi berlangsung, kecuali jika Anda juga menentukan parameter Force.
Remove-EC2VpnGateway -VpnGatewayId vgw-1a2b3c4d
Output:
Confirm Are you sure you want to perform this action? Performing operation "Remove-EC2VpnGateway (DeleteVpnGateway)" on Target "vgw-1a2b3c4d". [Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"):
-
Untuk detail API, lihat DeleteVpnGatewaydi Referensi Alat AWS untuk PowerShell Cmdlet (V4).
-
- Alat untuk PowerShell V5
-
Contoh 1: Contoh ini menghapus gateway pribadi virtual yang ditentukan. Anda diminta untuk konfirmasi sebelum operasi berlangsung, kecuali jika Anda juga menentukan parameter Force.
Remove-EC2VpnGateway -VpnGatewayId vgw-1a2b3c4d
Output:
Confirm Are you sure you want to perform this action? Performing operation "Remove-EC2VpnGateway (DeleteVpnGateway)" on Target "vgw-1a2b3c4d". [Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"):
-
Untuk detail API, lihat DeleteVpnGatewaydi Referensi Alat AWS untuk PowerShell Cmdlet (V5).
-