[Solved] Read timeout on endpoint URL: “https://lambda.[region].amazonaws.com/2015-03-31/functions/[function-name]/invocations”

0 min read 129 words

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.

https://docs.aws.amazon.com/cli/latest/reference/index.html

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
Tags:
Andrew
Andrew

Andrew is a visionary software engineer and DevOps expert with a proven track record of delivering cutting-edge solutions that drive innovation at Ataiva.com. As a leader on numerous high-profile projects, Andrew brings his exceptional technical expertise and collaborative leadership skills to the table, fostering a culture of agility and excellence within the team. With a passion for architecting scalable systems, automating workflows, and empowering teams, Andrew is a sought-after authority in the field of software development and DevOps.

Tags

Recent Posts