You need two things:
- IAM role or IAM user with permissions to call your lambda function in your code.
- To actually perform the calling action, using invoke method in boto3.
An alternative is to call your lambda function through an API Gateway. This does not require IAM roles or IAM user credentials for the caller. How to use lambda with API Gateway is shown in the following link:
- Build an API Gateway REST API with Lambda integration
You need two things:
- IAM role or IAM user with permissions to call your lambda function in your code.
- To actually perform the calling action, using invoke method in boto3.
An alternative is to call your lambda function through an API Gateway. This does not require IAM roles or IAM user credentials for the caller. How to use lambda with API Gateway is shown in the following link:
- Build an API Gateway REST API with Lambda integration
All you need to do in your Python script is call the invoke function.
Call AWS lambda function from an existing lambda function on Python 2.7 - Stack Overflow
Calling a python function from an AWS lambda function - Stack Overflow
amazon web services - Can an AWS Lambda function call another normal python function from a python file? - Stack Overflow
How do I programmatically invoke a Lambda functin?
I'm a network guy but I'm trying to wrap my head around this new cloud stuff. I get what Lambda does, and I know I can call functions via stuff like the web console, but how do I integrate them into a production workflow? Lots of lambda tutorials show you how to use the console and don't take it any farther than that.
Googling suggests there's both a Lambda API and, of course, API Gateway. Are those the same thing?
Is there a decent 'hello world' out there which lets you call a lambda function via curl/requests, for example?
thanks!