Courseiva
Development with AWS ServiceshardMultiple ChoiceObjective-mapped

DVA-C02 Development with AWS Services Practice Question

A company runs a containerized application on Amazon ECS Fargate. The application writes logs to stdout. The operations team wants to centralize log monitoring and set up alarms for error patterns. What should a developer do to meet these requirements with minimal operational overhead?

⚠ Common exam trap

The trap here is that candidates often overthink the solution and choose Option C (installing the CloudWatch agent) because they are familiar with it from EC2, forgetting that Fargate does not support host-level agents and that the awslogs driver is the built-in, agentless alternative.

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 ECS task definition to use the awslogs log driver and set the log group.

The awslogs log driver is the native, zero-configuration way to send container stdout/stderr to Amazon CloudWatch Logs from ECS Fargate. By specifying the awslogs log driver and a log group in the task definition, logs are automatically forwarded without any additional agents, code changes, or infrastructure, meeting the requirement for minimal operational overhead.

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 Amazon Kinesis Data Firehose to stream logs to Amazon S3 and then to CloudWatch Logs.

    Why it's wrong here

    Using Amazon Kinesis Data Firehose to route logs from ECS Fargate to Amazon S3 and then to CloudWatch Logs introduces unnecessary complexity and latency for a direct logging requirement. While Firehose is excellent for large-scale data ingestion and transformation pipelines, it is not the native or most efficient mechanism for standard container logs destined for CloudWatch Logs. This approach adds multiple components and potential points of failure that are not required when a simpler, integrated solution exists.

  • Modify the application code to use the AWS SDK for CloudWatch Logs to put log events.

    Why it's wrong here

    Modifying the application code to directly use the AWS SDK for CloudWatch Logs to push log events tightly couples the application logic with infrastructure concerns. This approach is generally discouraged as it increases development overhead, makes the application less portable, and is redundant when ECS provides a native log driver to capture standard output and error streams. The `awslogs` driver handles this transparently without requiring any changes to the application itself.

  • Install the CloudWatch agent in the container and configure it to send logs.

    Why it's wrong here

    Installing a CloudWatch agent within an ECS Fargate container is not a supported or practical solution due to the serverless nature of Fargate. Fargate abstracts away the underlying EC2 instances, meaning users do not have host-level access or the ability to persistently install and manage agents within the task's operating environment. This approach fundamentally misunderstands the operational model of AWS Fargate, which is designed for hands-off infrastructure management.

  • Configure the ECS task definition to use the awslogs log driver and set the log group.

    Why this is correct

    Configuring the ECS task definition to utilize the `awslogs` log driver is the recommended and most efficient method for sending container logs from Fargate tasks to Amazon CloudWatch Logs. This native integration automatically captures `stdout` and `stderr` streams from your containers and delivers them to a specified CloudWatch Logs log group. It simplifies log management, centralizes monitoring, and requires no application code changes or agent deployments within the container.

About these practice questions

This DVA-C02 question is part of Courseiva's 724-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 →

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.