How do I integrate API Gateway Web Socket with Internal NLB?

0

I have a backend service running on ECS and NLB Internal in front of it. I am using the below model for REST API: API Gateway REST API -> Internal NLB -> ECS

Currently, we are developing more chat features via WebSocket, is there any path for this model: API Gateway Web Socket -> Internal NLB -> ECS. Is this approach possible or do I have to create a public NLB or ALB for the WebSocket?

Thank you

1回答
0
承認された回答

API Gateway supports web sockets only from the client to the gateway itself. From the gateway to the backend (ECS behind NLB in your case), API gateway sends regular HTTP requests, i.e., for every messages API Gateway receives on the socket, it sends an HTTP request to the backend with the message in the payload. When the backend wants to send a message to the client, it sends an HTTP request to the @connections end point and ask the gateway to send the message to the client.

If you want a websocket all the way to your backend, you can't use API Gateway and you need to expose your NLB/ALB.

profile pictureAWS
エキスパート
Uri
回答済み 1ヶ月前
profile picture
エキスパート
レビュー済み 1ヶ月前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ