A biotechnology company has a multi-account AWS environment managed under AWS Organizations. Genomic sequencing applications run on Amazon EC2 instances across multiple member accounts. The application writes log files to a local directory `/var/log/sequencer/`. To manage disk space, the application rotates logs hourly, creating new files with timestamp suffixes (for example, `sequencer_20260716-11.log`). A Solutions Architect needs to design a centralized logging solution to collect these application logs and AWS CloudTrail logs from all member accounts into a single Amazon S3 bucket in a dedicated Security account. The architecture must stream application logs in real time and minimize operational overhead.
Which solution should the Solutions Architect implement to meet these requirements?
- AConfigure a cron job on the EC2 instances to run a script hourly that uses the AWS CLI to upload `/var/log/sequencer/sequencer_*.log` files directly to the Security account S3 bucket. Create individual AWS CloudTrail trails in each member account and configure them to deliver log files to a local S3 bucket in each account. Set up Amazon S3 Cross-Region Replication (CRR) to replicate the CloudTrail logs from the local buckets to the centralized S3 bucket in the Security account.
- BConfigure the CloudWatch agent on the EC2 instances with the static `file_path` parameter set to `/var/log/sequencer/sequencer.log`. Set up a cron job on the EC2 instances that runs hourly to copy the active timestamped log file to `/var/log/sequencer/sequencer.log`. Stream the logs to Amazon Kinesis Data Firehose to write to the Security account S3 bucket. Create an organization trail in AWS CloudTrail that delivers log files directly to the Security account S3 bucket, using a bucket policy that grants `s3:PutObject` permissions to the CloudTrail service principal with a condition checking for the Organization ID.
- Configure the CloudWatch agent on the EC2 instances with the `file_path` parameter set to `/var/log/sequencer/sequencer_*.log` to stream logs to Amazon CloudWatch Logs. Use CloudWatch Logs subscription filters to send the log events to a centralized Amazon Kinesis Data Firehose delivery stream that writes to the Security account S3 bucket. Create an organization trail in AWS CloudTrail that delivers log files directly to the Security account S3 bucket, ensuring the bucket policy grants `s3:PutObject` permissions to the CloudTrail service principal with a condition checking for the Organization ID.Cevap
- DConfigure the CloudWatch agent on the EC2 instances with the `file_path` parameter set to `/var/log/sequencer/sequencer_*.log` to stream logs to Amazon CloudWatch Logs. Use CloudWatch Logs subscription filters to send the log events to a centralized Amazon Kinesis Data Firehose delivery stream that writes to the Security account S3 bucket. Create an organization trail in AWS CloudTrail that delivers log files directly to the Security account S3 bucket, but configure the S3 bucket policy in the Security account to grant `s3:PutObject` permissions only to the IAM roles of the member accounts rather than the CloudTrail service principal.