AWS Certified SysOps Administrator – AssociateDeployment, Provisioning, and AutomationMedium
A SysOps engineer needs to automate the process of collecting logs from Amazon EC2 instances and sending them to Amazon CloudWatch Logs. The solution must be easy to deploy and manage across a fleet of instances, support both existing and newly launched instances, and handle log rotation. Which AWS service and agent combination is recommended?
- AUser data script to download and install the CloudWatch Agent.
- BAmazon Kinesis Agent with a Kinesis Data Firehose delivery stream.
- CCloudWatch Agent installed via AWS Systems Manager State Manager.
- DAWS Systems Manager Run Command to install a custom log collection script.
Show answer & explanationAnswer & explanation
Correct answer: C. CloudWatch Agent installed via AWS Systems Manager State Manager.
The CloudWatch Agent is the recommended solution for collecting logs and metrics from EC2 instances. When deployed and managed via AWS Systems Manager State Manager, it ensures consistent installation and configuration across a fleet, handles new instances automatically via associations, and natively supports log rotation to CloudWatch Logs.
Why the other options are wrong
- A. User data works for initial setup but lacks the centralized management, compliance enforcement, and easy updates that Systems Manager provides.
- B. Kinesis Agent is for streaming data to Kinesis services; while it can handle logs, the CloudWatch Agent is purpose-built and more direct for sending logs specifically to CloudWatch Logs.
- D. Run Command can install the agent, but State Manager ensures continuous compliance and automatic installation on new instances, which Run Command alone doesn't provide.
CloudWatch Agent
A unified agent for Amazon CloudWatch that collects metrics and logs from Amazon EC2 instances and on-premises servers.
- Collects system, application logs, and custom metrics.
- Supports both Windows and Linux.
- Integrates with Systems Manager for automated deployment.
Memory trick: CloudWatch Agent + State Manager, logs flow like water.