SaveMyCert
Log in
5 of 5 free questions left today·for 30 a day
DVA-C02 · Domain 3

Deployment practice questions

Deployment is worth 24% of the DVA-C02 exam — the 3rd-heaviest of the 4 domains. Preparing artifacts, testing in development environments, automating deployment testing, and CI/CD deployments. 6 fully worked examples are further down this page, answers included.

Exam weight
24%
the 3rd-heaviest of the 4 domains
Questions
80
across 4 topics
Free, no account
5/day
sign up free to remove the cap
Explanations
Every option
right and wrong

Build a practice session

5 free questions left today.

Domains

How many?

Mode

Ready when you are

10 fresh questions drawn across 1 of 4 domains, in Learn mode.

Focused review

Every question you answer incorrectly, and every question you flag while practising, is saved here automatically. Finish a session and you can come back to re-drill just those.

6 sample Deployment questions, fully explained

Questions from the DVA-C02 bank mapped to domain 3, with the answer key and the reasoning behind every option. None of them repeat the examples on the main DVA-C02 practice page.

Question 1Deployment

A developer zips a project folder and uploads the archive to AWS Elastic Beanstalk. The environment reports a successful deployment, but the application fails to start because the platform cannot find the application files. What is the MOST likely cause?

Choose one.

  • a
    The bundle is missing an .ebextensions directory

    .ebextensions holds optional environment configuration files; its absence does not prevent an application from starting.

  • b
    The application files are nested inside a parent folder in the archive instead of sitting at the root of the zip Correct

    Elastic Beanstalk requires source bundle files at the archive root; zipping the folder itself (rather than its contents) produces a bundle that deploys but fails to start.

  • c
    The source bundle must first be pushed to Amazon ECR

    ECR stores container images; Elastic Beanstalk source bundles are uploaded directly or referenced from S3, not from a container registry.

  • d
    The archive exceeds Lambda's 250 MB unzipped package limit

    The 250 MB unzipped limit applies to Lambda zip packages, not to Elastic Beanstalk source bundles.

The concept

An Elastic Beanstalk source bundle is a zip (or war) archive whose application files must sit at the root of the archive, with optional environment configuration in an .ebextensions directory inside the bundle.

Why that’s the answer

Zipping the project folder itself puts every file one directory too deep, so the platform cannot locate the application entry files — the deployment succeeds but startup fails, which is exactly the symptom described. A missing .ebextensions directory is harmless because it is optional. ECR is unrelated to Beanstalk source bundles, and the 250 MB unzipped limit is a Lambda constraint, not a Beanstalk one.

How to reason it out
  1. Open the uploaded archive and check whether files sit at the root or inside a parent folder.
  2. Re-create the bundle by zipping the contents of the project folder, not the folder itself.
  3. Keep any environment customization files in an .ebextensions directory inside the bundle.
  4. Redeploy the corrected bundle and confirm the application starts.

Exam tip: Zip the contents of the project folder for Elastic Beanstalk — a bundle whose files are nested one level deep deploys but fails to start.

Preparing Application Artifacts for AWS Deployment — the lesson that teaches this.

Question 2Deployment

A Lambda function's zip deployment package has grown to 300 MB unzipped. A developer proposes moving several large libraries into Lambda layers so the function fits within the package size limit. Why will this approach fail?

Choose one.

  • a
    Layer contents still count toward the function's 250 MB unzipped size limit Correct

    The 250 MB unzipped limit includes the function package plus all attached layers, so redistributing bytes into layers does not reduce the total.

  • b
    Lambda layers can only contain custom runtime code, not third-party libraries

    Layers are commonly used precisely for shared third-party libraries and dependencies, so this restriction does not exist.

  • c
    A Lambda function can attach only one layer at a time

    A function supports up to 5 layers, so the count is not the blocker — the combined size is.

  • d
    Layers can only be attached to functions packaged as container images

    Layers attach to zip-packaged functions; container-image functions bake dependencies into image layers instead.

The concept

Lambda layers share dependencies across functions, but everything in the function package plus its layers must fit within the 250 MB unzipped limit — layers are a code-sharing mechanism, not a size workaround.

Why that’s the answer

Because layer contents count toward the same 250 MB unzipped ceiling, splitting a 300 MB package across layers changes nothing about the total. The real fix for a package this large is repackaging the function as a container image, which allows up to 10 GB. The distractors invent restrictions that do not exist: layers routinely carry third-party libraries, a function can attach up to 5 layers, and layers belong to zip packaging rather than container packaging.

How to reason it out
  1. Total the unzipped size of the function package plus every attached layer.
  2. Compare that total against the 250 MB unzipped limit — layers do not get their own separate budget.
  3. If the total exceeds 250 MB, repackage the function as a container image of up to 10 GB in Amazon ECR.
  4. Reserve layers for their real purpose: sharing common dependencies across multiple functions.

Exam tip: Layers count toward the 250 MB unzipped limit — when a package outgrows it, the answer is a container image, not more layers.

Preparing Application Artifacts for AWS Deployment — the lesson that teaches this.

Question 3Deployment

Ten Lambda functions in a serverless application all bundle the same internal utilities library. Every time the library changes, the team must rebuild and redeploy all ten function packages. What should the developer do to reduce this maintenance overhead?

Choose one.

  • a
    Upload the library to Amazon S3 and have each function download it at the start of every invocation

    Downloading dependencies at invoke time adds latency and a runtime failure mode; dependencies must travel inside the artifact or its layers.

  • b
    Publish the shared library as a Lambda layer and attach the layer to each function Correct

    A layer extracts shared dependencies into a separately versioned archive, so a library change means publishing one new layer version instead of rebuilding ten zips.

  • c
    Merge the ten functions into a single Lambda function so the library is bundled once

    Collapsing functions to simplify packaging trades away the application's decomposition and scaling boundaries — a packaging problem should not drive an architecture change.

  • d
    Store the library's code in AWS AppConfig and load it as configuration at runtime

    AppConfig delivers runtime configuration and feature flags, not shared code libraries — code distribution is what layers are for.

The concept

Lambda layers extract dependencies shared by multiple functions into a separately versioned archive that each function attaches — up to 5 layers per function, all counting toward the 250 MB unzipped limit.

Why that’s the answer

With the utilities library in a layer, an update means publishing one new layer version and pointing the functions at it, rather than rebuilding and redeploying ten packages — exactly the scenario layers are designed for. Downloading code from S3 at invoke time adds latency and a new failure mode. Merging functions is an architecture change disguised as a packaging fix. AppConfig manages configuration data, not executable libraries.

How to reason it out
  1. Package the shared utilities library as a Lambda layer archive.
  2. Publish the layer and attach its version to each of the ten functions.
  3. On a library change, publish a new layer version and update the functions' layer references.
  4. Verify the combined function-plus-layers size stays within the 250 MB unzipped limit.

Exam tip: When many functions share the same dependency, publish it once as a Lambda layer and version it independently of the functions.

Preparing Application Artifacts for AWS Deployment — the lesson that teaches this.

Question 4Deployment

A team's Lambda builds are not reproducible: the dependency tree that CI resolves today differs from what it resolved for the same commit last month, because requirements.txt lists open version ranges. Which practice ensures that every build of a given commit resolves identical dependency versions?

Choose one.

  • a
    Have CI always install the newest available version of each dependency

    Always taking the newest version is the source of the drift — it guarantees builds change over time without any code change.

  • b
    Move the dependencies into a Lambda layer so CI no longer installs them

    A layer relocates where dependencies live but the layer build itself still resolves versions; without pinning, the layer drifts the same way.

  • c
    Commit a lock file with exact pinned versions to the repository and install from it in CI Correct

    Lock files such as poetry.lock, package-lock.json, or fully pinned requirements freeze the resolved dependency tree, so every build of that commit produces the same artifact.

  • d
    Increase the function's memory allocation so newer dependency versions run reliably

    Memory sizing affects CPU and performance, not which dependency versions the build resolves.

The concept

Lock files make builds reproducible by freezing the exact dependency tree, guaranteeing that the artifact built and tested today is byte-for-byte rebuildable from the same commit later.

Why that’s the answer

Committing a lock file (or fully pinned requirements) means CI installs exactly the versions that were tested, eliminating the drift between builds of the same commit. Always installing the newest versions is precisely what causes the problem. Moving dependencies into a layer only relocates the unpinned resolution step. Memory allocation is a runtime sizing decision with no effect on dependency resolution.

How to reason it out
  1. Generate a lock file that pins every dependency, direct and transitive, to an exact version.
  2. Commit the lock file to the Git repository next to the dependency manifest.
  3. Configure CI to install strictly from the lock file during sam build or the equivalent packaging step.
  4. Update dependencies deliberately by regenerating the lock file in a reviewed commit.

Exam tip: Pin dependencies with a committed lock file so the artifact you tested is the artifact every future build reproduces.

Preparing Application Artifacts for AWS Deployment — the lesson that teaches this.

Question 5Deployment

A Python Lambda function deployed with AWS SAM fails on every invocation with the error "Unable to import module 'app'". The template declares CodeUri: src/orders/ and Handler: app.lambda_handler. What should the developer verify FIRST?

Choose one.

  • a
    That a file named app.py defining a function called lambda_handler exists at the root of the src/orders/ directory Correct

    Handler: app.lambda_handler means the file app.py at the root of CodeUri must define lambda_handler; an import error signals that the file name, function name, or location disagrees with the handler string.

  • b
    That the function's execution role grants s3:GetObject on the deployment bucket

    Missing deployment permissions surface as deployment failures, not as a module import error inside a successfully deployed function.

  • c
    That template.yaml has been moved inside the src/orders/ directory

    The SAM template conventionally lives at the project root; its location does not change how the handler string resolves within CodeUri.

  • d
    That the function's memory allocation is at least 512 MB

    Memory affects CPU and performance; it has no effect on whether the runtime can locate and import the handler module.

The concept

In a SAM project, CodeUri points at the function's source directory and Handler names the entry point within it — for Python, Handler: app.lambda_handler requires app.py at the root of CodeUri to define lambda_handler.

Why that’s the answer

"Unable to import module 'app'" means the runtime could not find or load the module named in the handler string, so the first check is whether app.py with a lambda_handler function actually sits at the root of src/orders/. Deployment-bucket permissions would have failed the deploy itself, the template's own location is irrelevant to handler resolution, and memory sizing cannot cause an import failure.

How to reason it out
  1. Read the Handler value and split it: module name app, function name lambda_handler.
  2. Confirm app.py exists at the root of the CodeUri directory, not in a subfolder.
  3. Confirm the file defines a function with the exact name lambda_handler.
  4. Run sam build and inspect .aws-sam/build/ to verify the packaged layout matches the handler path.

Exam tip: Handler import errors mean the file name, function name, or CodeUri directory disagrees with the Handler string — check the paths before anything else.

Preparing Application Artifacts for AWS Deployment — the lesson that teaches this.

Question 6Deployment

After running sam build for the first time, a developer notices a new .aws-sam/build/ directory containing resolved artifacts and a rewritten template. How should the team handle this directory in the Git repository?

Choose one.

  • a
    Commit it so teammates can deploy without running sam build themselves

    Committing generated output bloats the repository and drifts from source; teammates and CI should produce artifacts by building from source and the lock files.

  • b
    Commit only the rewritten template from inside it and ignore the rest

    The rewritten template is also generated and is only valid alongside the built artifacts it references; the authored template.yaml at the project root is the source of truth.

  • c
    Add it to .gitignore because it is generated build output that sam deploy ships from Correct

    .aws-sam/build/ is produced by sam build and regenerated on every build, so like node_modules and local .env files it belongs in .gitignore, not in version control.

  • d
    Move its contents to the repository root so CodeUri paths resolve without rebuilding

    Merging build output into the source tree confuses source with artifacts and breaks the clean separation the build relies on.

The concept

Build output is separate from source: sam build writes resolved artifacts and a rewritten template to .aws-sam/build/, and sam deploy ships from there — the directory is generated, not authored.

Why that’s the answer

Because .aws-sam/build/ is fully regenerated by every build, it belongs in .gitignore alongside node_modules and local .env files; the repository holds what humans author — source, template.yaml, manifests, and lock files. Committing the whole directory or just its rewritten template stores derived output that will drift from source, and moving build output into the source tree destroys the source-versus-artifact separation that makes builds trustworthy.

How to reason it out
  1. Add .aws-sam/ to .gitignore along with other generated paths such as node_modules.
  2. Keep the authored template.yaml, dependency manifests, and lock files committed at the project root.
  3. Let CI run sam build to regenerate .aws-sam/build/ from source on every pipeline run.
  4. Publish the built artifacts to the artifact store (S3) rather than to Git.

Exam tip: Never commit generated build output — the repository holds what you author, and the build regenerates .aws-sam/build/ from it every time.

Preparing Application Artifacts for AWS Deployment — the lesson that teaches this.

What DVA-C02 domain 3 tests, topic by topic

The official exam guide breaks Deployment into 4 topics. The question bank follows the same split, so a weak topic shows up as a cluster of misses you can go back and read.

Published DVA-C02 practice questions per topic in Deployment
TopicWhat it coversQuestions
Prepare application artifacts to be deployed to AWSExam guide task 3.1. Managing code-module dependencies via environment variables, configuration files, and container images; file/directory structure for deployment; code repositories in deployment environments; resource requirements (memory, cores); per-environment application configuration (e.g. AWS AppConfig).20
Test applications in development environmentsExam guide task 3.2. Testing deployed code with AWS services and tools; integration tests and mock APIs for external dependencies; development endpoints (e.g. API Gateway stages); deploying stack updates to existing environments (e.g. a SAM template to staging); testing event-driven applications.20
Automate deployment testingExam guide task 3.3. Creating test events (JSON payloads for Lambda, API Gateway, SAM); deploying API resources to environments; approved-version strategies (Lambda aliases, container image tags, Amplify branches); implementing and deploying infrastructure-as-code templates (SAM, CloudFormation); managing per-service environments (dev/test/prod in API Gateway); generating automated tests with Amazon Q Developer.20
Deploy code by using AWS CI/CD servicesExam guide task 3.4. Lambda deployment packaging; API Gateway stages and custom domains; updating IaC templates; configuring blue/green, canary, and rolling deployment strategies and rollbacks; orchestrated workflows across environments; commit-triggered build/test/deploy (CodeBuild, CodeDeploy, CodePipeline); labels and branches for version and release management; dynamic deployments via runtime configuration (e.g. API Gateway stage variables read from Lambda).20
Total80

Revise Deployment before you drill it

Other DVA-C02 domains

Deployment: your questions

Deployment is domain 3 of the DVA-C02 exam guide and carries 24% of the scored content — the 3rd-heaviest of the 4 domains. On a 65-question paper that works out to roughly 16 questions, though AWS does not publish an exact per-domain count and individual exam forms vary.

Source

The domain weight and topic list on this page come from the official DVA-C02 exam guide.