What is the PRIMARY benefit of this action?
Improves legibility and stylistic convention
Takes advantage of runtime environment reuse
Provides better error handling
Creates a new SDK instance for each invocation
Explanations:
Initializing the SDK outside the Lambda handler does not primarily affect legibility or stylistic convention. It is related to performance optimization.
Initializing the SDK outside the handler takes advantage of Lambda’s execution environment reuse, improving performance by reusing resources across invocations.
While error handling is important, initializing the SDK outside the handler does not directly improve error handling. It mainly impacts performance.
Creating a new SDK instance for each invocation would degrade performance. Initializing outside the handler reuses the SDK instance across invocations, improving efficiency.