SO I'm using boto to invoke my lambda functions and test my backend. I want to invoke them asynchronously. I have noted that "invoke_async" is deprecated and should not be used. Instead you should use "invoke" with an InvocationType of "Event" to do the function asynchronously.
I can't seem to figure out how to get the responses from the functions when they return though. I have tried the following:
client = boto3.client('lambda')
for x in range (0, 5):
response = client.invoke(
An asynchronously executed AWS Lambda function doesn't return the result of execution. If an asynchronous invocation request is successful (i.e. there were no errors due to permissions, etc), AWS Lambda immediately returns the HTTP status code 202 ACCEPTED and bears no further responsibility for communicating any information about the outcome of this asynchronous invocation.
From the documentation of AWS Lambda Invoke action:
HTTP/1.1 StatusCode X-Amz-Function-Error: FunctionError X-Amz-Log-Result: LogResult Payload
If the action is successful, the service sends back the following HTTP response.
The HTTP status code will be in the 200 range for successful request. For the
RequestResonseinvocation type this status code will be 200. For the
Eventinvocation type this status code will be 202. For the
DryRuninvocation type the status code will be 204.
The response returns the following as the HTTP body.
It is the JSON representation of the object returned by the Lambda function. This is present only if the invocation type is