

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# 刪除 AWS Site-to-Site VPN 連線和閘道
<a name="delete-vpn"></a>

如果您不再需要 AWS Site-to-Site VPN 連線，則可以將其刪除。當您刪除站台對站台 VPN 連接時，我們不會刪除與站台對站台 VPN 連接相關聯的客戶閘道或虛擬私有閘道。您可以刪除不再需要的客戶閘道和虛擬私有閘道。

**警告**  
如果您刪除站台對站台 VPN 連接，然後建立新的連接，您必須下載新的組態檔案，然後重新設定客戶閘道裝置。

**Topics**
+ [刪除 VPN 連接](delete-vpn-connection.md)
+ [刪除客戶閘道](delete-cgw.md)
+ [分離和刪除虛擬私有閘道](delete-vgw.md)

# 刪除 AWS Site-to-Site VPN 連線
<a name="delete-vpn-connection"></a>

刪除站台對站台 VPN 連接之後，它會在一段時間內保持顯示並處於 `deleted` 狀態，然後系統會自動移除該項目。

**使用主控台刪除 VPN 連接**

1. 在 [https://console.aws.amazon.com/vpc/](https://console.aws.amazon.com/vpc/) 開啟 Amazon VPC 主控台。

1. 在導覽窗格中，選擇**站台對站台 VPN 連接**。

1. 選取 VPN 連接，然後選擇**動作**、**刪除 VPN 連接**。

1. 出現確認提示時，請輸入 **delete**，然後選擇 **Delete** (刪除)。

**使用命令列或 API 刪除 VPN 連接**
+ [DeleteVpnConnection](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DeleteVpnConnection.html) (Amazon EC2 Query API)
+ [delete-vpn-connection](https://docs.aws.amazon.com/cli/latest/reference/ec2/delete-vpn-connection.html) (AWS CLI)
+ [Remove-EC2VpnConnection](https://docs.aws.amazon.com/powershell/latest/reference/items/Remove-EC2VpnConnection.html) (AWS Tools for Windows PowerShell)

# 刪除 AWS Site-to-Site VPN 客戶閘道
<a name="delete-cgw"></a>

您可以刪除不再需要的客戶閘道。您不能刪除站台對站台 VPN 連接中正在使用的客戶閘道。

**使用主控台刪除客戶閘道**

1. 在導覽窗格中，選擇**客戶閘道**。

1. 選取客戶閘道，然後選擇**動作**、**刪除客戶閘道**。

1. 出現確認提示時，請輸入 **delete**，然後選擇 **Delete** (刪除)。

**使用命令列或 API 刪除客戶閘道**
+ [DeleteCustomerGateway](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DeleteCustomerGateway.html) (Amazon EC2 Query API)
+ [delete-customer-gateway](https://docs.aws.amazon.com/cli/latest/reference/ec2/delete-customer-gateway.html) (AWS CLI)
+ [Remove-EC2CustomerGateway](https://docs.aws.amazon.com/powershell/latest/reference/items/Remove-EC2CustomerGateway.html) (AWS Tools for Windows PowerShell)

# 在 中分離和刪除虛擬私有閘道 AWS Site-to-Site VPN
<a name="delete-vgw"></a>

您可以分離不再需要用於 VPC 的虛擬私有閘道。

**使用主控台分離虛擬私有閘道**

1. 在導覽窗格中，選擇**虛擬私有閘道**。

1. 選取虛擬私有閘道，然後選擇 **Actions (動作)**、**Detach from VPC (自 VPC 分離)**。

1. 選擇**分離虛擬私有閘道**。

您可以刪除不再需要的分離虛擬私有閘道。您不能刪除仍然連接至 VPC 的虛擬私有閘道。刪除虛擬私有閘道之後，它會在一段時間內保持顯示並處於 `deleted` 狀態，然後系統會自動移除該項目。

**使用主控台刪除虛擬私有閘道**

1. 在導覽窗格中，選擇**虛擬私有閘道**。

1. 選取虛擬私有閘道，然後選擇**動作**、**刪除虛擬私有閘道**。

1. 出現確認提示時，請輸入 **delete**，然後選擇 **Delete** (刪除)。

**使用命令列或 API 分離虛擬私有閘道**
+ [DetachVpnGateway](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DetachVpnGateway.html) (Amazon EC2 Query API)
+ [detach-vpn-gateway](https://docs.aws.amazon.com/cli/latest/reference/ec2/detach-vpn-gateway.html) (AWS CLI)
+ [Dismount-EC2VpnGateway](https://docs.aws.amazon.com/powershell/latest/reference/items/Dismount-EC2VpnGateway.html) (AWS Tools for Windows PowerShell)

**使用命令列或 API 刪除虛擬私有閘道**
+ [DeleteVpnGateway](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DeleteVpnGateway.html) (Amazon EC2 Query API)
+ [delete-vpn-gateway](https://docs.aws.amazon.com/cli/latest/reference/ec2/delete-vpn-gateway.html) (AWS CLI)
+ [Remove-EC2VpnGateway](https://docs.aws.amazon.com/powershell/latest/reference/items/Remove-EC2VpnGateway.html) (AWS Tools for Windows PowerShell)