Send request to Lambda from another Lambda through API Gateway (Python).

0

Hi,

I'm trying to write a 'health-check' Lambda which calls a few of our other Lambda functions to ensure that our application is healthy.

How can I do this in Python? I'm thinking that I can just use requests.get() to the correct URL or is there a better way?

4개 답변
0

Hi,

If you consider your existing application with API gateway like an "external API", this post details the Python code to do what you want : https://blog.devgenius.io/making-a-call-to-external-api-from-aws-lambda-resides-within-vpc-python-6184f5fe233a

Best,

Didier

profile pictureAWS
전문가
답변함 4달 전
0

If you're just looking to invoke an lambda, there's a boto3 call for this.

Can you tell us a bit more what you're trying to accomplish? What does "healthy" mean to your application?

profile pictureAWS
답변함 4달 전
0

The example Lamda which I am starting with makes a call to a third party API. I want to make sure that I get a 200 from the third party. This will ensure that the third party is up and responding and also that our Lambda is working and making the call.

Mick B
답변함 4달 전
0

Why don’t you monitor your lambda in Cloudwatch metrics and lambda insights and alert on failed invocations etc

profile picture
전문가
답변함 4달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠