0

I have implemented an API server using Django and Django-REST-Framework with Zappa in AWS Lambda. I use Auth0 for identity. When I try to signup or login from localhost it works well and good but when I try to do the same from the AWS domain it throws timeout errors.

URL: https://api.bearete.com/api/v1/signup/

Logs:

Starting new HTTPS connection (1): arete.auth0.com

Task timed out after 30.03 seconds

I need help to solve this issue. Thank you.

Community
  • 1
  • 1
Rohan
  • 477
  • 7
  • 22

1 Answers1

0

As correctly suggested by @MattHealy AWS Lambda runs in a VPC and by default lambda don't give internet access.

When you enable VPC, your Lambda function will lose default internet access. If you require external internet access for your function, ensure that your security group allows outbound connections and that your VPC has a NAT gateway.

To solve this create few public subnets(at least 2) which has assigned to a IGW (Internet Gateway) and create few private subnets(at least 2) which has assigned to a NAT gateway and modify the route table accordingly for IGW and NAT to complete the connectivity. Now, assign the private subnets to the Lambda and the respective security groups and your lambda will have the internet connection.

Rohan
  • 477
  • 7
  • 22