Failed to send request - Lambda can't connect to External API

0

I have two lambda functions. One connects to an ECS instance using a VPC. The second should also connect to that same ECS instance and an API (api.twitter.com). The first function works perfectly, i've been able to write and read from files within the instance. However, the second can connect to the API without the VPC, but immediately the VPC is added it gives me a

"errorMessage": "Failed to send request: HTTPSConnectionPool(host='api.twitter.com', port=443)

About my VPC

  • I have 2 public subnets and 2 private subnets - in two separate availability zones
  • I have an Internet gateway attached to my VPC
  • I have 2 route tables(public and private
  • My internet gateway is routed to my public route table
  • I also have an NAT gateway connected to my public subnet
  • That NAT gateway is routed to my private route table

I have gone back and forth with all the connections highlighted above trying to solve this issue. I need my function to access ECS and also connect to the internet API. Please help me.

  • I am facing the exact same issue, the lambda with vpc connected cannot request to external network (verify google recaptcha). I basically have the same VPC configuration with you. Did you find any solutions?

2 回答
0

What does the Security Group for the Lambda function look like?

profile pictureAWS
专家
kentrad
已回答 2 年前
0
  • Yes, that has been my guide i honestly don't know where i'm missing it. But i guess i have to do more troubleshooting

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则