I'm trying to call another lambda function from an existing lambda fucntion as below (python 2.7)
from __future__ import print_function
import boto3
import json
lambda_client = boto3.client('lambda')
def lambda_handler(event, context):
invoke_response = lambda_client.invoke(FunctionName="teststack",
InvocationType='RequestResponse'
)
print(invoke_response)
return str(invoke_response)
I'm gettting the below response instead of an actual result. When I run teststack lambda invidually it works fine, but getting below response instead of "test" returned by the teststack
Lambda function.
{u'Payload': <botocore.response.StreamingBody object at ****>, 'ResponseMetadata': {'HTTPStatusCode': 200, 'RequestId': '******', 'HTTPHeaders': {'x-amzn-requestid': '******', 'content-length': '155', 'x-amzn-remapped-content-length': '0', 'connection': 'keep-alive', 'date': 'Sun, 17 Jul 2016 21:02:01 GMT', 'content-type': 'application/json'}}, u'StatusCode': 200}