How to call one lambda function using another?

+1 vote
I have two lambda function, one creates records and other creates ticket for that record. I tried almost everything but could not find how to call one function from another can anyone help me with this?
Mar 26, 2019 in AWS by tyler
1,219 views

1 answer to this question.

0 votes

Here is how I did it using python boto3.

from boto3 import client as boto3_client
from datetime import datetime
import json
lambda_client = boto3_client('lambda')
def lambda_handler(event, context):
    msg = {"key":"new_invocation", "at": datetime.now()}
    invoke_response = lambda_client.invoke(FunctionName="another_lambda_",
                                           InvocationType='Event',
                                           Payload=json.dumps(msg))
    print(invoke_response)
answered Mar 26, 2019 by Esha

Related Questions In AWS

+1 vote
1 answer
0 votes
1 answer

How do I invoke another lambda async and pass context to it?

I tried several times trying to pass ...READ MORE

answered Apr 27, 2018 in AWS by Cloud gunner
• 4,630 points
3,260 views
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
2 answers

How to kill a lambda function in AWS?

$ aws lambda put-function-concurrency --function-name my-function --reserved-concurrent-executions ...READ MORE

answered Mar 28, 2019 in AWS by Shashank
• 1,370 points
6,718 views
0 votes
1 answer