Data Operations and Support

An Amazon ECS task on AWS Fargate writes pipeline logs to standard output. Its task execution role already permits CloudWatch Logs writes, and the destination log group exists. Which task definition change automatically sends the logs there?

Show the answer

Correct answerA. Configure the awslogs log driver with the log group, Region, and stream prefix.

AWhy this is right: The awslogs driver routes container output to the specified CloudWatch Logs group and stream.

BWhy not this: CloudTrail records supported AWS API activity, not application output from containers.

CWhy not this: Subscription filters forward ingested log events to supported destinations; they do not collect ECS container output.

DWhy not this: Metric filters extract metric values from logs already ingested into a log group.

The awslogs log driver sends container standard output and standard error to CloudWatch Logs using the task definition's log configuration. Subscription filters forward logs that have already reached CloudWatch Logs; they do not collect container output.