If you get the following error:

Read timeout on endpoint URL: "https://lambda.<region>.amazonaws.com/2015-03-31/functions/<function-name>/invocations"

Then you are probably trying to use the aws cli to invoke an AWS Lambda function and it is timing out.

Other than making sure to set the Lambda execution time to something much higher than it is, you also need to make sure to specify the aws cli --cli-read-timeout argument to something that will cover the execution time.


Your original aws lambda invoke command

aws lambda invoke --invocation-type RequestResponse --function-name <function-name> --region <region> --log-type Tail --payload {"key":"value"} output.txt

Your updated aws lambda invoke command

Make sure to add --cli-read-timeout 900 (or equivalent time to match your lambda execution time)

aws lambda invoke --invocation-type RequestResponse --function-name <function-name> --region <region> --log-type Tail --cli-read-timeout 900 --payload {"key":"value"} output.txt