I'm trying to store the output of lambda function using ResultPath in input so that I can use that as a input in other states of step function but the step function cancelled within in few sec after adding ResultPath.
Lambda Function :
def lambda_handler(event, context):
# TODO implement
import boto3
s3 = boto3.client('s3')
data = s3.get_object(Bucket='test1', Key='Testing-sandbox/Test_sql_script.sql')
contents = data['Body'].read()
print(contents)
return contents
Lambda function output :
Response
"/* Step - 1 */ \r\nSELECT * FROM test1 LIMIT 10;\r\n/* Step - 2 */ \r\nSELECT * FROM test2 limit 10;\r\n"
Step Function :
{
"StartAt": "CallFunction",
"States": {
"CallFunction": {
"Type": "Task",
"Resource": "arn:aws:lambda:us-west-2:12345678:function:readFile",
"ResultPath": "$.query",
"End": true
}
}
}
I'm relatively new to AWS and unable debug the issue. Can someone explain this/direct me to the right documentation?
Any help/links are highly appreciated.