DVA-C02 - Deployment (24% of the exam) - Section 3.1

Prepare AWS Lambda deployment artifacts using deployment packages, layers, container images and managed code dependencies.

Prepare AWS Lambda deployment artifacts as ZIP deployment packages, shared Lambda layers for reusable dependencies, or container images for larger runtimes. Choose the correct artifact format based on size constraints, dependency sharing needs, and consistency with existing container tooling.

Lambda deployment packageLambda layersContainer image deploymentDependency management

Practice question for this objective

Free sampleDeploymentmedium

A developer packages a Python Lambda function whose dependencies, including a large machine learning library and its native binaries, total around 900 MB once unzipped. The deployment must be a single artifact that Lambda can run directly. The developer wants the simplest packaging option that supports this artifact size. Which deployment package format should the developer use?

  • AUpload the function as a .zip archive directly through the Lambda console, since direct uploads accept artifacts of this unzipped size without extra steps.
  • BStore the .zip archive in an S3 bucket and point Lambda at the object, because the S3 path raises the unzipped limit high enough for this dependency set.
  • CBuild the function as a container image, push it to Amazon ECR, and create the function from that image, because image packages support far larger artifacts. Correct
  • DSplit the dependencies across five Lambda layers so each stays small, then attach all five layers to the function to assemble the full library at runtime.
Choose a Lambda container image when a function's unzipped code and dependencies exceed the limits of zip-based deployment packages. Zip deployment packages, whether uploaded directly or from S3, are bound by a two hundred and fifty megabyte unzipped limit shared by the function and its layers, so a nine hundred megabyte dependency set only fits a container image, which Lambda supports up to ten gigabytes and runs directly from Amazon ECR.

Why A is wrong: A direct console .zip upload is capped at fifty megabytes zipped, and the unzipped code and dependency limit for zip packages is far below nine hundred megabytes, so this artifact cannot be deployed that way.

Why B is wrong: Loading the zip from S3 raises the upload size but the unzipped code and layers still cannot exceed two hundred and fifty megabytes, so a nine hundred megabyte payload remains over the zip format limit.

Why C is correct: Lambda container images support sizes up to ten gigabytes, comfortably holding a nine hundred megabyte dependency set, and Lambda runs the image directly as a single deployment artifact.

Why D is wrong: Layers share the same two hundred and fifty megabyte unzipped ceiling that the function plus all attached layers must fit within, so splitting the library across layers does not raise the total budget.

See more DVA-C02 practice questions, answers explained.

Exam traps in Deployment

Answers that look right on this material and are not. Each one is a distractor from a different question in the DVA-C02 bank for this domain.

  • A .zip deployment package uploaded straight to Lambda, since the direct upload path accepts archives well beyond a few gigabytes for the function and its bundled dependencies.

    Why it is wrong: Direct .zip upload is tempting for its simplicity, but the zipped package is capped at 50 MB on direct upload and 250 MB unzipped, so a 4 GB payload cannot fit.

  • The image can be stored in Docker Hub and Lambda will pull it directly from there when the function is invoked.

    Why it is wrong: Pulling from a public registry sounds plausible, but Lambda sources container images only from Amazon ECR, not Docker Hub or other external registries.

  • Add an AWS CLI install step to the image so the container can call Lambda service endpoints and register itself with the runtime when it starts.

    Why it is wrong: The AWS CLI issues service API calls and has nothing to do with the per-invocation runtime API contract, so installing it does not let Lambda hand events to the function handler.

Examworthy is not affiliated with or endorsed by Amazon Web Services. Original, blueprint-aligned practice material only.