I have multiple Lambda functions. I am calling another Lambda function from the first Lambda function using Lambda invoke in python. I have an object instance of the class which has has the dictionary data. I also want to pass the object instance to the other lambda functions with the json object. How can I do it?
objReferenceData = ReferenceData()
objReferenceData_dict = objReferenceData.__dict__
"This objReferenceData_dict contains all the data which have dictonary object."
## First lambda
inputForInvoker = responsejson
logger.info(inputForInvoker)
response = client.invoke(
FunctionName = 'arn:aws:firstfun',
InvocationType = 'RequestResponse',
Payload = json.dumps(inputForInvoker)
)
responsejson = json.load(response['Payload'])
return responsejson
else:
pass
## second lambda
inputForInvoker = responsejson
response = client.invoke(
FunctionName = 'arn:aws:secondfun',
InvocationType = 'RequestResponse',
Payload = json.dumps(inputForInvoker)
)
responsejson = json.load(response['Payload'])
else:
pass
I want to pass the objReferenceData_dict with the responsejson. I tried to send that, adding this objReferenceData_dict to the responsejson but the data is too large. The lambda handler only has a limit of 6mb.