AWS Certified Developer Associate DVA-C01 – Question279

A developer converted an existing program to an AWS Lambda function in the console. The program runs properly on a local laptop, but shows an “Unable to import module” error when tested in the Lambda console.
Which of the following can fix the error?

A.
Install the missing module and specify the current directory as the target. Create a ZIP file to include all files under the current directory, and upload the ZIP file.
B. Install the missing module in a lib directory. Create a ZIP file to include all files under the lib directory, and upload the ZIP file as dependency file.
C. In the Lambda code, invoke a Linux command to install the missing modules under the /usr/lib directory.
D. In the Lambda console, create a LB_LIBRARY_PATH environment and specify the value for the system library path.

Correct Answer: D

Explanation: