Connecting the API Gateway to a private VPC

0

Hello, everybody. I am new to AWS, maybe this question is trivial, but I will be glad of any help. The question is, is it possible to connect the REST API Gateway endpoint to a private network without using a load balancer? I will describe the structure in more detail. So, I used Elastic Beanstalk in order to deploy the application using Tomcat. When setting up the environment, I chose a default VPC and, at the level of the security group created for the EC2 server, limited HTTP traffic only to use the IP subnet from the VPC. After that, I made a new REST endpoint, in which I specified the Beanstalk provided DNS as the destination point. However, without additional settings, requests do not reach the server, as they are blocked by the security group. I read about VPC links in the AP Gateway I and, as far as I understand, the basic solution would be to make such a link and make requests through it, however, from the documentation and UI, I can only make the link that would point to the Network Load Balancer. The problem is that at the current stage of the project, the load balancer seems superfluous to me. I have only one server and would not like to connect additional balancing resources for one server. I'm wondering if I can make a new VPC endpoint myself through the VPC console and use it for queries, or maybe there is better method to implement this. All this is necessary for a simple requirement: all requests to the server should be possible only through the API Gateway endpoint, I want to remove the ability to initiate HTTP requests to the server through the provided public domains (EC2 domain, Beanstal domain). For this purpose, I have placed Beanstalk resources on a private network, but I cannot find a solution to connect Beanstalk and API Gateway.

1 個回答
0
已接受的答案

The load balancer is required if you are going to use API Gateway to access your private VPC.

Although it's a little more effort, how about using API Gateway to trigger a Lambda function that is linked to your VPC? Then have that Lambda function make the call to your privately hosted server.

profile pictureAWS
專家
已回答 5 個月前
profile picture
專家
已審閱 5 個月前
  • Thank you very much for the response. I will try this solution.

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

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

回答問題指南