AWS Certified Developer – Associate — Question 368
A developer needs to deploy an application to AWS Elastic Beanstalk for a company. The application consists of a single Docker image. The company's automated continuous integration and continuous delivery (CI/CD) process builds the Docker image and pushes the image to a public Docker registry.
How should the developer deploy the application to Elastic Beanstalk?
Answer options
- A. Create a Dockerfile. Configure Elastic Beanstalk to build the application as a Docker image.
- B. Create a docker-compose.yml file. Use the Elastic Beanstalk CLI to deploy the application.
- C. Create a .zip file that contains the Docker image. Upload the .zip file to Elastic Beanstalk.
- D. Create a Dockerfile. Run the Elastic Beanstalk CLI eb local run command in the same directory.
Correct answer: B
Explanation
Since the Docker image is already built and hosted in a public registry, the developer can use a docker-compose.yml file to reference this pre-built image and deploy it using the Elastic Beanstalk CLI. Option A is incorrect because Elastic Beanstalk does not need to build the image since it is already built by the CI/CD process. Options C and D are incorrect because uploading a raw image zip file is unsupported for pre-built deployments, and eb local run only executes the container locally rather than deploying it to the AWS cloud.