Create API GW Websocket API that is only accessible from within a VPC.

0

Hi, I want to create Websocket API in the AWS APIGW, but, that it only only accessible from within a VPC (because I want to integrate it in with CloudFront, i.e., the authentication will be in the CloudFront using signed cookie or URL).

I could not find any documentation that do it.

Thanks,

已提問 2 年前檢視次數 1937 次
1 個回答
1

API Gateway Websockets APIs do not support private APIs so you can't really prevent access to the API from any location. Saying that, you mention CloudFront as the way to access the API. If you use CloudFront, the requests are not routed via a VPC.

One way to achieve that only requests that came from CloudFront are handled by API Gateway is to add sone secret between CloudFront and API GW. This can be done by adding a new header with a specific value in CloudFront and create a Lambda Authorizer in API GW that verifies the value in the header.

profile pictureAWS
專家
Uri
已回答 2 年前
profile picture
專家
已審閱 1 個月前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南