AWS Certified Data Engineer – Associate (DEA-C01) — Question 151
A data engineer maintains custom Python scripts that perform a data formatting process that many AWS Lambda functions use. When the data engineer needs to modify the Python scripts, the data engineer must manually update all the Lambda functions.
The data engineer requires a less manual way to update the Lambda functions.
Which solution will meet this requirement?
Answer options
- A. Store the custom Python scripts in a shared Amazon S3 bucket. Store a pointer to the custom scripts in the execution context object.
- B. Package the custom Python scripts into Lambda layers. Apply the Lambda layers to the Lambda functions.
- C. Store the custom Python scripts in a shared Amazon S3 bucket. Store a pointer to the customer scripts in environment variables.
- D. Assign the same alias to each Lambda function. Call each Lambda function by specifying the function's alias.
Correct answer: B
Explanation
The correct answer is B because using Lambda layers allows the data engineer to package the Python scripts once and share them across multiple Lambda functions, making updates simpler. Options A and C involve using S3, which still requires manual updates to each function. Option D does not address the issue of script updates at all.