Site icon Exam4Training

Which solution will meet this requirement?

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?
A . Store a pointer to the custom Python scripts in the execution context object in a shared Amazon
S3 bucket.
B . Package the custom Python scripts into Lambda layers. Apply the Lambda layers to the Lambda
functions.

C . Store a pointer to the custom Python scripts in environment variables in a shared Amazon S3 bucket.
D . Assign the same alias to each Lambda function. Call reach Lambda function by specifying the function’s alias.

Answer: B

Explanation:

Lambda layers are a way to share code and dependencies across multiple Lambda functions. By packaging the custom Python scripts into Lambda layers, the data engineer can update the scripts in one place and have them automatically applied to all the Lambda functions that use the layer. This reduces the manual effort and ensures consistency across the Lambda functions. The other options are either not feasible or not efficient. Storing a pointer to the custom Python scripts in the execution context object or in environment variables would require the Lambda functions to download the scripts from Amazon S3 every time they are invoked, which would increase latency and cost. Assigning the same alias to each Lambda function would not help with updating the Python scripts, as the alias only points to a specific version of the Lambda function code.

Reference: AWS Lambda layers

AWS Certified Data Engineer – Associate DEA-C01 Complete Study Guide, Chapter 3: Data Ingestion and Transformation, Section 3.4: AWS Lambda

Exit mobile version