nerdexam
Amazon

DVA-C02 · Question #649

A company is developing an application that uses an AWS Lambda function that runs every time a file is uploaded to an Amazon S3 bucket. The Lambda function needs to access third-party libraries that a

The correct answer is D. Create a Lambda layer that contains the third-party libraries. Add the Lambda layer to the. Using a Lambda layer to include third-party libraries improves runtime performance by avoiding repeated S3 fetches during execution. Setting the environment name as an environment variable allows easy configuration for multiple stages (e.g., dev, test, prod) and enables dynamic c

Submitted by viktor_hu· Mar 5, 2026Deployment

Question

A company is developing an application that uses an AWS Lambda function that runs every time a file is uploaded to an Amazon S3 bucket. The Lambda function needs to access third-party libraries that are stored in an Amazon S3 bucket to run successfully. The developer wants to deploy the Lambda function to multiple environments, including development, testing, and production environments. Based on the deployment stage, the application sends custom messages to the application log. The developer needs to optimize the deployment for Lambda function runtime performance. Which solution will meet these requirements?

Options

  • AConfigure the Lambda function to read the third-party libraries from Amazon S3 when the function
  • BConfigure the Lambda function to read the third-party libraries from Amazon S3 when the function
  • CCreate a Lambda layer that contains the third-party libraries. Add the Lambda layer to the
  • DCreate a Lambda layer that contains the third-party libraries. Add the Lambda layer to the

How the community answered

(27 responses)
  • A
    4% (1)
  • B
    4% (1)
  • C
    7% (2)
  • D
    85% (23)

Explanation

Using a Lambda layer to include third-party libraries improves runtime performance by avoiding repeated S3 fetches during execution. Setting the environment name as an environment variable allows easy configuration for multiple stages (e.g., dev, test, prod) and enables dynamic customized logging. This approach is optimal for both performance and maintainability.

Community Discussion

No community discussion yet for this question.

Full DVA-C02 Practice