How can I make API gateway only available to my ec2 instance?

Joey Yi Zhao

I deployed a lambda to AWS and created an api gateway to access it. I don't want the API gateway to be public because the lambda is only called from one of my ec2 instance. What is the best way to configure it to secure this API? My ec2 instance needs public IP address since I have DNS configure route pointing to it.

John Rotenstein

Since you are only using the AWS Lambda function from a single Amazon EC2 instance, there is no need to use API Gateway. (API Gateway is normally used to expose an API to a large number of users.)

You can instead invoke an AWS Lambda function directly:

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

How I can make that the request to 'api.mydomain.com:8000' redirect to IP for the EC2 instance

How can I reduce latency between my AWS EC2 instance and another AWS customer's REST API

how to I make HTTPS url/link work to my amazon EC2 instance?

How can I route api gateway endpoint to ec2 private IP

How can I renew my SSL certificate on aws normal ec2 instance

How can I automatically spin up my ec2 instance, run a command and then shut it down?

How can i convert my ec2 instance from http to https?

How do i make the pytest driver instance available in my testcase

How do I disconnect from my EC2 Instance?

How do make my microservices only accessible by the api gateway

How can I SSH inside a Redhat EC2 instance?

How can I perform autoscaling in amazon ec2 instance?

How can I install xclip on an EC2 instance?

How can I access an EC2 instance created by CDK?

How I can avoid that a EC2 instance be turns on by itself

How can I configure an AWS autoscaling group/launch configuration with Terraform to only run a cron job on one EC2 instance?

Why can I not ping my EC2 instance when I've set up the VPC and EC2 via Terraform?

How can I get Wireshark with a GUI on my EC2?

How to connect Amazon API Gateway with my custom API in EC2

How can i make a method available only from within the class

How can i make only one choice available from 3?

How can I make my webserver running on android publically available

How can I make my textfield fill the available vertical space?

How can I make the LLVM IR of a function available to my program?

How can I make ALB forward traffic to API Gateway?

Why can't I find my express code at AWS EB'S EC2 instance?

Why I can't connect through SSH to my EC2 instance? Permission denied

I can't get anything to install when running User Data for my EC2 instance

Can I access my Lambda from EC2 instance within private VPC?