Yogesh
Yogesh

Reputation: 31

How do I resolve timeout issue while connecting a AWS Lambda with EFS

I have ensure that the Lambda is in the same VPC as the EFS. Lambda has the same Security Group as the mounts. The mounts have all the permissions. However, when I run the Lambda function, it times out with following message - org.apache.axis2.AxisFault: The host did not accept the connection within timeout of 30000 ms.

The time out for lambda is set at 5 minutes.

Upvotes: 1

Views: 2282

Answers (2)

David Webster
David Webster

Reputation: 2321

After checking all your networking issues make sure to add a access point for EFS.

As well as you have to configure the lambda to use the EFS filesystem

enter image description here

You can always diagnose the issue further with VPC Flow logs on the ENI.

Upvotes: 0

John Rotenstein
John Rotenstein

Reputation: 269320

Resources in the same Security Group cannot communicate with each other unless a rule is added that explicitly allows the Security Group to communicate with "itself". This is because security groups are applied to each resource individually. There is no concept of multiple resources being "inside" a security group.

Instead, I would recommend creating:

  • A Security Group on the Lambda function (Lambda-SG) with default "Allow All Outbound" settings
  • A Security Group on the EFS Mount Point (EFS-SG) that permits inbound NFS access from Lambda-SG

That is, EFS-SG should specifically reference Lambda-SG in the inbound rules.

Upvotes: 4

Related Questions