1
votes

I have 1 Lambda Function connected to AWS Oracle RDS. I have exposed lambda to outer world via API Gateway.

How can i access same API Gateway in my EC2 Instance where i have my back-end services running?

[ec2-user@ip-22-22-22-22 dummy]$ ./telnet  10apexecute2.execute-api.eu-west-1.amazonaws.com 443
Trying 55.11.144.98...

Please help

1
Can you clarify? Is the EC2 instance in a private subnet? Does it have internet access? - Marcin
Is your instance public or private? If is public does it have an internet gateway attached to its routing table? If its private does it have a NAT attached to its routing table? - Chris Williams
It's in private subnet. And do not have internet access. - ANUJ AGARWAL
You can add a private endpoint to your VPC and your routing tables. Take a look at aws.amazon.com/blogs/compute/… - Chris Williams
@ChrisWilliams thanks a lot it was i quick setup :) - ANUJ AGARWAL

1 Answers

1
votes

As the account must be restrictive with its outbound communication over internet, the suggested solution would to make use of a VPC endpoint for API Gateway.

Once you create this endpoint, make sure to enable the "Enable Private DNS Name" option to override the DNS resolution for execute-api endpoints to speak to resolve through your VPC endpoint.

More information can be found in this blog post: Introducing Amazon API Gateway Private Endpoints | AWS Compute Blog