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
profile pictureAWS
回答済み 2年前
  • 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

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ