Home > Software engineering >  How to invoke Lambda function using boto3 and passing parameters
How to invoke Lambda function using boto3 and passing parameters

Time:06-15

This time I'm looking for passing parameters to lambda invoke using boto3.client instead of make a request to API gateway.

Assume I developed a lambda function that can be invoked through api get. ie: https://linktolambda/<parameter> and now I am trying to access same lambda function from another one using boto3 client.

I have read documentation from:

I have read stackoverflow questions, reddit questions, medium posts, etc. but I haven't found what I'm looking for.

Thanks in advance.

CodePudding user response:

Look at the Official AWS Code Example Github. For Python Code examples look here:

https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/python

You can find how to invoke a Lambda function and pass parameters (exactly what you are looking for) in this code example:

https://github.com/awsdocs/aws-doc-sdk-examples/blob/main/python/example_code/lambda/lambda_basics.py

Look at line 184.

CodePudding user response:

There is no boto3 api for that. You have to just make regular request to it like to any other website. For example, using requests library in python.

  • Related