AWS lambda in VPC can not connect with Elastic search

Viewed 1655

I have created an AWS Lambda in a VPC, as I want to access Easticsearch. As I have defined the Lambda in VPC and to access public internet I have configured a NAT gateway. The Lambda needs to persists some data in Elasticsearch.

Now when I run the Lambda Java code - it gives below error

org.apache.http.conn.ConnectTimeoutException: Connect to <ELASTIC SEARCH DOMAIN URL> failed: connect timed out.
  • The elastic search code work with Lambda with VPC.
  • As I have created a NAT gateway i have update the routing table too
0 Answers
Related