Courseiva
Deployment →easyMultiple Choice

DVA-C02 Deployment Practice Question

A developer is using AWS Elastic Beanstalk to deploy a Python web application. The application requires a specific version of a Python package that is not pre-installed on the Elastic Beanstalk platform. How should the developer ensure the package is installed on all environment instances?

⚠ Common exam trap

Candidates often overcomplicate Elastic Beanstalk deployments by assuming custom configuration files (`.ebextensions`) or Docker containers are required for basic dependency management. For supported platforms like Python, Node.js, and Ruby, Elastic Beanstalk natively respects standard package managers (like `requirements.txt`, `package.json`, or `Gemfile`).

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

✓

Add the package to a requirements.txt file and deploy it with the application source bundle.

AWS Elastic Beanstalk natively supports Python package management. If you include a `requirements.txt` file in the root directory of your source bundle, Elastic Beanstalk automatically installs the specified packages (and their specific versions, e.g., `package==1.2.3`) using `pip` during the deployment process. While `.ebextensions` can run custom commands, using it to install Python packages is non-standard, complex (due to virtual environment paths on Amazon Linux 2/2023), and unnecessary.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✗

    Use the AWS CLI to run a script on each instance after deployment.

    Why it's wrong here

    Manually executing AWS CLI commands or scripts on individual instances post-deployment is an anti-pattern for Elastic Beanstalk. This approach lacks automation, is prone to human error, and breaks the immutable infrastructure paradigm, making it impossible to guarantee consistent environments across scaled instances or during rollbacks. Elastic Beanstalk aims for declarative configuration and automated provisioning, which this manual intervention bypasses.

  • ✗

    Include a .ebextensions configuration file that runs a command to install the package.

    Why it's wrong here

    .ebextensions configuration files provide a robust mechanism to customize Elastic Beanstalk environments by executing commands, installing packages, or modifying server configurations during the instance provisioning lifecycle. By placing a .ebextensions file in the .ebextensions directory of the source bundle, a developer can specify commands or container_commands to run shell scripts or install system-level packages that are not handled by standard Python dependency managers like pip. This ensures the package is consistently installed across all instances in the environment.

  • ✓

    Add the package to a requirements.txt file and deploy it with the application source bundle.

    Why this is correct

    While requirements.txt is the standard and preferred method for declaring Python application dependencies that pip can install, it is primarily designed for Python packages available via PyPI or specified URLs. This method is insufficient for installing system-level packages, libraries that require specific compilation flags, or dependencies that need custom shell commands to set up. For such non-standard or operating system-level requirements, requirements.txt alone cannot fulfill the installation.

  • ✗

    Create a custom Dockerfile and use the Docker platform in Elastic Beanstalk.

    Why it's wrong here

    Adopting a custom Dockerfile and switching to the Docker platform for a Python application, solely to install a package, introduces unnecessary complexity and overhead. While Docker provides excellent isolation and portability, it requires maintaining a Dockerfile, managing image builds, and potentially increasing deployment times and resource consumption. For simple package installations or environment customizations, the native Python platform combined with .ebextensions offers a more direct and efficient solution without the added containerization layer.

About these practice questions

Courseiva writes every DVA-C02 question from scratch — 1,135 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This DVA-C02 practice question is part of Courseiva's free Amazon Web Services certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the DVA-C02 exam.