import boto3
client = boto3.client('lambda')
#Value to put in Lambda's event variable
query = {
"test1": "test",
"test2": "test"
}
#Run Lambda
response = client.invoke(
FunctionName='LAMBDA_FUNCTION_NAME',
InvocationType='RequestResponse',
LogType='Tail',
Payload= query
)
#Read the response
res = response['Payload'].read()
Reference: http://boto3.readthedocs.io/en/latest/reference/services/lambda.html#Lambda.Client.invoke
Recommended Posts