0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

プライベートサブネットの Windows Server EC2 から VPC ピアリング先の EC2 にアクセスする手順の備忘録

Posted at

🧭 背景

構築中のシステムにおいて、異なる2つのVPC間でWindowsサーバを接続する必要が発生。

  • 接続元EC2はプライベートサブネット(インターネット非公開)
  • Session Manager / Fleet Manager を利用して接続元EC2にログイン
  • VPCピアリングは完了済み
  • 接続先のEC2もWindows Server、リモート接続を実施したい

✅ 前提条件

  • 両方のEC2に AWS Systems Manager Agent(SSM Agent)がインストール・有効化済み
  • EC2に AmazonSSMManagedInstanceCore ポリシーを持つIAMロールがアタッチされている
  • VPCピアリング済み(VPC-A ↔ VPC-B)
  • 両VPCのルートテーブルが相互に設定済み
  • 必要なポート(例:RDP)がセキュリティグループで許可されている

✅ セッションマネージャーに必要なVPCエンドポイント一覧

  • com.amazonaws.<region>.ssm
  • com.amazonaws.<region>.ec2messages
  • com.amazonaws.<region>.ssmmessages

🗺️ 簡易想定図

rds.drawio.png


🚀 手順

  1. Fleet Manager 接続

    • 接続元EC2の接続ボタン → RDPクライアントのFleet Manager → Desktopを選択 → キーペアをアップロードして接続
  2. ルートテーブル設定

    • VPC-A のルートテーブルに
      • 宛先:VPC-B の CIDR
      • ターゲット:VPCピアリング接続ID
    • VPC-B も同様に、逆方向のルート設定を追加
  3. セキュリティグループ設定

    • EC2-B のセキュリティグループに
      • 送信元:VPC-A の CIDR または EC2-A のセキュリティグループからRDPを許可
  4. リモート接続(RDP)

    • 接続元EC2(Windows)からRDPクライアントを起動
    • IPアドレスまたはホスト名を指定
    • ユーザー名とパスワードを入力して接続

🔍 要確認ポイント

  • EC2に IAMロール(SSM関連)が正しくアタッチされているか
  • 両VPC間のルートテーブルに、CIDRとピア接続先が設定されているか
  • VPCエンドポイント(Systems Manager用)にアタッチする セキュリティグループで443ポートのインバウンド許可 があるか

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?