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 Answer
1
Accepted Answer

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
EXPERT
answered 10 months ago
profile picture
EXPERT
reviewed 5 months ago
profile picture
EXPERT
reviewed 10 months ago
  • Thank you very much for the response. I will try this solution.

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions