Thiwanka Wickramage
Thiwanka Wickramage

Reputation: 902

How to communicate with private EC2 instance from Lambda function

Lets say we have a ec2 instance that running in the private subnet. No Public IP associated with this instance. There is a running application (server with endpoint) inside this instance.

Problem is I need to access this application endpoint through a Lambda function. If that instance had a public IP we could directly make a call to the instance but this instance is a private instance.

Is there any way to communicate with that private EC2 instance through a Lambda function?

Upvotes: 4

Views: 11431

Answers (1)

Maurice
Maurice

Reputation: 13197

You can place a Lambda function inside of the VPC and configure the security groups to allow traffic from the Lambda function.

AWS Docs: Configuring a Lambda function to access resources in a VPC

Upvotes: 7

Related Questions