DVA-C02 exam dumps

DVA-C02 practice question 227 of 399

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

DVA-C02 Question 227

Single answer

You are developing an AWS Lambda function that requires access to a large, external library for data processing. The library size exceeds the deployment package limit of 50 MB when compressed. How can you include this library in your Lambda function while staying within AWS Lambda's deployment package size limits?

  1. A

    Include the library in a Lambda layer and configure your function to use the layer.

  2. B

    Compress the library further and include it in the deployment package.

  3. C

    Split the library into smaller parts and upload each part as a separate Lambda function.

  4. D

    Use Amazon S3 to store the library and download it within the Lambda function during execution.

Show answer and explanation

Correct answer: A

Explanation

The best way to include a large external library in your AWS Lambda function is by using Lambda layers. Layers allow you to package and share common code, libraries, or dependencies across multiple Lambda functions without including them in the deployment package. This not only helps you stay within deployment package size limits but also improves maintainability and reduces redundancy.

  • A. Correct.

    Correct. Lambda layers are specifically designed to allow you to include external libraries, dependencies, or other custom code that can be shared across multiple Lambda functions. This approach helps you stay within the deployment package size limits.

  • B. Incorrect.

    Incorrect. AWS Lambda has a hard limit of 50 MB for the compressed deployment package size, and further compression would not solve this issue as it would likely still exceed the limit.

  • C. Incorrect.

    Incorrect. Splitting the library into smaller parts and creating multiple Lambda functions is not an effective solution. Lambda functions are not inherently designed to share code or work in this manner.

  • D. Incorrect.

    Incorrect. While storing the library in S3 and downloading it during execution is technically possible, it would significantly increase the cold start time and execution time of the Lambda function, which is not ideal for performance.

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