CV0-004 Operations and Support Practice Question
A cloud engineer manages an application running on Amazon ECS with the Fargate launch type. The application occasionally experiences task failures during deployment. The engineer wants to inspect the container's standard output and standard error to determine why a task stopped, without modifying the application to write to a file. Which action should the engineer take?
⚠ Common exam trap
The trap here is assuming that a stopped Fargate task can be inspected interactively, when Fargate provides no host access and stopped tasks cannot be entered.
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
✓
Configure the task definition to use the awslogs log driver and view the logs in CloudWatch Logs
For ECS tasks on Fargate, container stdout and stderr must be directed to a logging destination through a log driver in the task definition. The awslogs driver forwards those streams to CloudWatch Logs, where the engineer can review output from both running and stopped tasks. SSH is unavailable, ECS Exec only works on running tasks, and ECR stores images rather than runtime logs.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Connect to the Fargate task using SSH to read the container's console output
Why it's wrong here
Fargate tasks do not expose an SSH endpoint by default and do not provide host access, so connecting via SSH is not possible. The engineer cannot read console output this way, and the approach misinterprets how Fargate abstracts the underlying infrastructure, making it an invalid method for inspecting container logs.
- ✗
Retrieve the task's output from the Amazon ECR repository where the image is stored
Why it's wrong here
Amazon ECR stores container images, not runtime output. The image repository contains the application's packaged layers and metadata, but it does not record stdout or stderr produced when a task runs, so it cannot provide the diagnostic information the engineer needs about why a task stopped.
- ✓
Configure the task definition to use the awslogs log driver and view the logs in CloudWatch Logs
Why this is correct
Configuring the task definition's container to use the awslogs log driver sends the container's stdout and stderr streams to a specified CloudWatch Logs log group and stream. This captures the output the engineer needs to diagnose why a task stopped, and it requires no application changes because Docker's logging mechanism handles the capture.
- ✗
Enable ECS Exec on the service and run docker logs inside the container to retrieve output
Why it's wrong here
ECS Exec allows an interactive shell into a running container, but it does not help retrieve logs from a task that has already stopped, and the docker command is not available inside the container to read its own logs. This approach also does not capture output after the task exits, making it unsuitable for post-mortem investigation.
Go deeper
Related to this question
About these practice questions
This CV0-004 question is part of Courseiva's 834-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →
JA
Written and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed September 2026 · checked against the official CompTIA exam blueprint
This CV0-004 practice question is part of Courseiva's free CompTIA 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 CV0-004 exam.