Create an AWS API Gateway integration with private VPC resource

Stefano Monti
AWS Infrastructure
Published in
3 min readDec 28, 2022

Access to your AWS account console, if you don’t have an AWS account, follow this link: https://docs.aws.amazon.com/accounts/latest/reference/manage-acct-creating.html.

Click on Build in the HTTP API section:

Select your API Gateway name and click Next:

Just click next:

Just click next, and AWS will create the $default stage automatically, be sure the Auto-deploy is enabled:

Just click Create:

Now your API gateway has been created; go to Routes in the left menu under Develop section, and click the Create button in the main box:

Create a new route with method ANY and path /{proxy+}, and click Create:

Now you have a new Route created; Select it and click on Attach Integration in the Route details section:

Just click on Create and attach an integration:

Complete all the fields like the image below; in this case, the integration is made with an internal load balancer inside a customer vpc like this:

Time for testing the new integration!! On the main page of the created API Gateway, you can find the public URL under Invoke URL.

Let’s check the response; if you want to know how to build a microservices infrastructure that responds to the following test requests, you can follow this tutorial.

!! IMPORTANT !!

This integration makes it public services that probably are not. If you created an internal Load Balancer, you probably don’t want to make it public. The scope of this implementation is only to test internal API without the use of a bastion host.
Deactivate the API Gateway after your test has finished!

Bye 😘

--

--