AWS Certified Developer – Associate — Question 223
A business intelligence application runs on Amazon Elastic Container Service (Amazon ECS) on AWS Fargate. Application-level audits require a searchable log of all API calls from users to the application. The application’s developers must store the logs centrally on AWS.
Which solution will meet these requirements?
Answer options
- A. Install the Amazon CloudWatch agent on the Amazon EC2 host that runs Fargate.
- B. Configure the awslogs log driver in the ECS task definition.
- C. Configure AWS CloudTrail for the ECS containers.
- D. Install the ECS logs collector on the ECS hosts.
Correct answer: B
Explanation
The correct answer, B, is appropriate because configuring the awslogs log driver in the ECS task definition allows the application logs to be sent directly to Amazon CloudWatch Logs, enabling centralized and searchable logging. Option A is incorrect since Amazon Fargate does not use EC2 hosts directly. Option C is not suitable as AWS CloudTrail focuses on API calls made to AWS services rather than application-level logs. Option D is also incorrect because there is no ECS logs collector that operates on ECS hosts in the context of Fargate.