Upgrade to Pro — share decks privately, control downloads, hide ads and more …

2025-06-20 PrivateLinkがNLBなしで作れるようになり便利になった

Avatar for SUZUKI Masashi SUZUKI Masashi
June 19, 2025
170

2025-06-20 PrivateLinkがNLBなしで作れるようになり便利になった

Avatar for SUZUKI Masashi

SUZUKI Masashi

June 19, 2025
Tweet

Transcript

  1. Copyright © 3-shake, Inc. All Rights Reserved. おまえだれよ 2 •

    すずきまさし/masasuzu/@masasuz • 株式会社スリーシェイク Sreake事業部所属 • クラウドインフラなんでも屋さんをしてます ◦ 設計、運用、構築等の支援をやってます。 ◦ 支援だけでなく実作業もなんでもやります。 • AWSちょっとわかる ◦ AWS Community Builder Cloud Operation Since 2024 • Google Cloudほんのちょっとわかる • Terraformちょっとわかる
  2. 従来はNLBの設置が必須でした。 • 構成要素 ◦ VPC Endpoint ◦ Endpoint Service ◦

    NLB ▪ Target Group • Target Copyright © 3-shake, Inc. All Rights Reserved. 従来のPrivateLink構成 8
  3. NLBはTarget Groupで転送する先のターゲットを指定できるのですが、以下のものが設定できます。 • インスタンス • IPアドレス • Lambda関数 • Application

    Load Blancer 特にIPアドレスを使用する場合に問題となります。 Copyright © 3-shake, Inc. All Rights Reserved. 従来のPrivateLink構成の課題 9
  4. Access Amazon RDS across VPCs using AWS PrivateLink and Network

    Load Balancer | AWS Database Blog Copyright © 3-shake, Inc. All Rights Reserved. 解決策(全体像) 11
  5. 1. Amazon RDS フェイルオーバープロセスにより、新しいプライマリインスタンス IP が Route 53 に更新されます。 2.

    フェイルオーバーイベントを契機に SNSトピックにトリガーされます。 3. SNSトピックにサブスクリプションされている Lambda関数を起動します。 4. Lambda 関数は、RDSエンドポイントの IP を取得し、Network Load Balancer から現在登録されている IP を取得 します。 5. 両方のIPアドレスが同一かどうかを確認します。同一でない場合は、エンドポイントを指す新しい IPアドレスを Network Load Balancerに登録し、古いIPアドレスをNetwork Load Balancerから登録解除します。 6. これで、すべての新しいユーザー接続が新しいプライマリ インスタンスにリダイレクトされます。 Copyright © 3-shake, Inc. All Rights Reserved. 解決策(手順) 12
  6. • 最近のアップデートでNLBが不要でPrivateLinkが構成できるようになりました。 • 構成要素 ◦ VPC Endpoint (Resource Endpoint) ◦

    Resource Configuration ◦ Resource Gateway Copyright © 3-shake, Inc. All Rights Reserved. Resource Gatewayを利用したPrivateLink 15
  7. • NLBを使用したPrivateLinkには課題があった ◦ IP指定しているターゲットがフェイルオーバーした際など、 IPの付け替えをする必要があった。 • Resource Gatewayを使用したPrivateLinkはリソース指定にDNS Nameが使える。 ◦

    そのため、IPアドレスにまつわるもろもろの管理をしなくても済むようになった。 ◦ 若干煩雑なNLBの設定をしなくてすむようになった Copyright © 3-shake, Inc. All Rights Reserved. まとめ 19
  8. • AWS PrivateLink(AWS でホストされているサービスに安全にアクセス) | AWS • What is AWS

    PrivateLink? - Amazon Virtual Private Cloud • Access Amazon RDS across VPCs using AWS PrivateLink and Network Load Balancer | AWS Database Blog • AWS が AWS PrivateLink 経由での VPC リソースへのアクセスを発表 - AWS • Securely share AWS resources across VPC and account boundaries with PrivateLink, VPC Lattice, EventBridge, and Step Functions | AWS News Blog • Access VPC resources through AWS PrivateLink - Amazon Virtual Private Cloud Copyright © 3-shake, Inc. All Rights Reserved. 参考リンク 20