Courseiva
Deployment →mediumMultiple Select

DVA-C02 Deployment Practice Question

A developer is deploying a web application using AWS Elastic Beanstalk. Which TWO configuration files can be used to customize the software that runs on the EC2 instances? (Select TWO.)

⚠ Common exam trap

Watch out — candidates often confuse Elastic Beanstalk configuration files with other AWS services' configuration files (like CodeDeploy's appspec.yml or CodeBuild's buildspec.yml) or assume a Dockerfile is universally applicable, when in fact only `.platform/hooks/` and `.ebextensions/*.config` are the two valid options for customizing software on EC2 instances in Elastic Beanstalk.

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

✓

.platform/hooks/

The `.platform/hooks/` directory is a feature of Elastic Beanstalk's platform-specific configuration that allows you to run custom scripts at specific lifecycle events (e.g., prebuild, postdeploy) on the EC2 instances. This is the modern replacement for the older `.ebextensions` approach for running commands during deployment, and it directly customizes the software running on the instances.

Answer analysis

Option-by-option breakdown

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

  • ✓

    .platform/hooks/

    Why this is correct

    Elastic Beanstalk utilizes the `.platform/hooks/` directory to execute custom scripts at specific points during the application deployment lifecycle. These hooks, categorized as pre-init, pre-build, pre-deploy, and post-deploy, enable developers to perform tasks like installing dependencies, running database migrations, or modifying server configurations. This provides fine-grained control over the environment's setup and application startup process.

  • ✗

    Dockerfile

    Why it's wrong here

    A `Dockerfile` is essential for defining the environment and dependencies of a containerized application when deploying to an Elastic Beanstalk Docker environment. However, it primarily specifies how to build the application's image, not the general deployment process or instance configuration for non-Docker platforms. It does not provide mechanisms for configuring AWS resources or executing lifecycle hooks directly within Elastic Beanstalk's deployment pipeline.

  • ✓

    .ebextensions/*.config

    Why this is correct

    The `.ebextensions/*.config` files are crucial for customizing the AWS resources and software configuration of an Elastic Beanstalk environment. These YAML or JSON files allow developers to provision and configure EC2 instances, load balancers, databases, and other services, as well as install packages or modify server settings. They are processed during environment creation and updates, enabling declarative infrastructure as code within Elastic Beanstalk.

  • ✗

    appspec.yml

    Why it's wrong here

    The `appspec.yml` file is a core component of AWS CodeDeploy, defining the source files, permissions, and lifecycle event hooks for deploying an application revision to target instances. While CodeDeploy can be integrated with Elastic Beanstalk, `appspec.yml` is not directly used by Elastic Beanstalk's native deployment process for application bundles. Elastic Beanstalk manages its own deployment orchestration without requiring this specific CodeDeploy artifact.

  • ✗

    buildspec.yml

    Why it's wrong here

    A `buildspec.yml` file is specifically designed for AWS CodeBuild projects, outlining the commands and phases required to build source code, run tests, and produce artifacts. It dictates how an application is compiled or packaged, rather than how it is deployed to an environment. Elastic Beanstalk expects a pre-built application source bundle for deployment and does not directly interpret or execute `buildspec.yml` during its deployment workflow.

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.