When writing a Lambda function, what is the benefit of instantiating AWS clients outside the scope of the handler?

Posted by: Pdfprep Category: DVA-C01 Tags: , ,

When writing a Lambda function, what is the benefit of instantiating AWS clients outside the scope of the handler?
A . Legibility and stylistic convention
B . Taking advantage of connection re-use
C . Better error handling
D . Creating a new instance per invocation

Answer: B

Explanation:

Reference: https://www.jeremydaly.com/reuse-database-connections-aws-lambda/

Leave a Reply

Your email address will not be published.