DVA-C02 exam dumps

DVA-C02 practice question 220 of 399

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

DVA-C02 Question 220

Select 2

You are tasked with deploying a Python-based web application to AWS Elastic Beanstalk. The application requires specific Python libraries listed in a 'requirements.txt' file. What steps should you take to prepare the application artifact for deployment?

  1. A

    Bundle the application code along with the 'requirements.txt' file in a ZIP archive.

  2. B

    Include a 'Procfile' in the application bundle to specify the application's entry point.

  3. C

    Pre-install the Python libraries locally and include the installed packages folder in the ZIP archive.

  4. D

    Ensure the application code is stored in a Git repository and deploy directly from Git.

  5. E

    Define the runtime environment and dependencies in an 'environment.yml' file instead of 'requirements.txt' for Python.

Show answer and explanation

Correct answers: A, B

Explanation

To prepare a Python application for deployment to AWS Elastic Beanstalk, you must ensure that the application code and all necessary files, like 'requirements.txt', are included in a ZIP archive. Including a 'Procfile' is also recommended to specify the application's entry point. Elastic Beanstalk handles installing dependencies during deployment, so pre-installing them locally is unnecessary.

  • A. Correct.

    'Bundle the application code along with the 'requirements.txt' file in a ZIP archive.' is correct. Elastic Beanstalk requires the application source bundle to include all necessary files, including the 'requirements.txt' for installing dependencies.

  • B. Correct.

    'Include a 'Procfile' in the application bundle to specify the application's entry point.' is correct. A 'Procfile' is often used to define the command that starts the application, which is necessary for Elastic Beanstalk to run the application correctly.

  • C. Incorrect.

    'Pre-install the Python libraries locally and include the installed packages folder in the ZIP archive.' is incorrect. Elastic Beanstalk handles dependency installation via 'requirements.txt', so pre-installing libraries is not required.

  • D. Incorrect.

    'Ensure the application code is stored in a Git repository and deploy directly from Git.' is incorrect. While Elastic Beanstalk supports deployment from Git, it is not required to deploy from Git specifically. You can deploy using a ZIP bundle instead.

  • E. Incorrect.

    'Define the runtime environment and dependencies in an 'environment.yml' file instead of 'requirements.txt' for Python.' is incorrect. Elastic Beanstalk expects a 'requirements.txt' file for Python dependencies, not an 'environment.yml' file.

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