【发布时间】:2022-06-19 02:28:11
【问题描述】:
我有多个 Lambda 函数。我在 python 中使用 Lambda 调用从第一个 Lambda 函数调用另一个 Lambda 函数。我有一个具有字典数据的类的对象实例。我想另外将对象实例传递给带有 json 对象的其他 lambda 函数。我该怎么做?
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.
【问题讨论】:
标签: python amazon-web-services aws-lambda