0
0

More than 3 years have passed since last update.

AWS VPNの削除

Posted at

事象

AWS Site-to-Siteの設定が残っており、毎日課金が発生していたので削除しようと思ったが、
The VPN gateway is in use.と出力されて削除ができなかった。

事前確認

VPCからデタッチされていることを確認

試したこと

  1. コンソールから削除
  2. Cloud Shellから削除

Cloud Shellの場合以下のようなコマンドとなる

aws ec2 delete-customer-gateway --customer-gateway-id CGWのID

aws ec2 delete-vpn-gateway --vpn-gateway-id VGWのID

しかしこれでも削除はできなかった。

原因

サイト間のVPN接続の設定が残っていた。
この設定で仮想プライベートゲートウェイ(VGW)とカスタマーゲートウェイ(CGW)を紐づけていたため、The VPN gateway is in use.と出力されていた模様。

感想

作業をしているうちに、VGWをどのサービス(VPCやサイト間のVPC接続)で利用したかが曖昧になっていた。

こういった作業をするときは、まずは全体の俯瞰図を用意しておかないと、後で全体の構成がわからなくなり、削除や設定変更の時にも困ると感じた。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0