DVA-C02 exam dumps

DVA-C02 practice question 225 of 399

AWS Certified Developer - Associate. Associate level, Amazon Web Services. Free question with the correct answer and a full explanation.

DVA-C02 Question 225

Single answer

You are developing an AWS Lambda function that processes data from an S3 bucket. The function requires a custom Python library that is not included in the standard Lambda runtime. Additionally, you need to ensure that the library can be shared across multiple Lambda functions in the same account to minimize maintenance overhead. How should you package and deploy your Lambda function?

  1. A

    Include the custom library in the deployment package as a .zip file and upload it directly to the Lambda function.

  2. B

    Use an AWS Lambda layer to package the custom library and attach the layer to your Lambda function.

  3. C

    Include the custom library in the deployment package and store the .zip file in an S3 bucket, then reference it in the Lambda function.

  4. D

    Use AWS Systems Manager Parameter Store to store the custom library and retrieve it during the Lambda execution.

Show answer and explanation

Correct answer: B

Explanation

AWS Lambda layers are specifically designed to package and share libraries, custom runtimes, or other dependencies across multiple Lambda functions. By using a layer, you can avoid duplicating the library in each function's deployment package, which simplifies maintenance and reduces deployment size.

  • A. Incorrect.

    This approach works but does not allow sharing the library across multiple Lambda functions. Each function would need its own copy, increasing maintenance overhead.

  • B. Correct.

    Using an AWS Lambda layer allows you to package custom libraries separately and share them across multiple Lambda functions, making it a more efficient solution.

  • C. Incorrect.

    Storing the .zip file in S3 and referencing it is not a standard method for Lambda deployment packaging. Lambda functions cannot directly use libraries from S3.

  • D. Incorrect.

    AWS Systems Manager Parameter Store is designed for storing configuration data and secrets, not for managing or distributing code libraries.

Timed practice exam

Take a DVA-C02 practice test under exam conditions

65 questions in 130 minutes, drawn from this bank, with a score report and a per-question review when you finish.

Start timed exam