An enterprise runs a critical application on Amazon EC2 instances within an Auto Scaling group in a Production AWS account. The application generates business logs located at `/var/log/app/transaction.log`. These logs are rotated hourly and renamed using the format `/var/log/app/transaction.log-YYYYMMDD-HH`. The company's compliance policy requires that all logs be consolidated into a centralized Amazon OpenSearch Service domain managed in a dedicated Security AWS account. The solution must ensure zero data loss during log file rotations, tolerate downstream OpenSearch Service ingestion throttling or outages, and adhere strictly to the principle of least privilege. Which of the following approaches is the MOST operationally excellent and secure way to implement this logging architecture?
- Configure the CloudWatch agent on the EC2 instances with the log path set to `/var/log/app/transaction.log*` to monitor active and rotated log files. Send the logs to a local CloudWatch log group. In the Security account, create a CloudWatch Logs destination resource pointing to a local Kinesis Data Firehose delivery stream, and attach an access policy allowing the Production account to publish to it. In the Production account, create a CloudWatch Logs subscription filter on the log group pointing to the Security account's destination ARN. Configure the Kinesis Data Firehose stream to deliver logs to the Amazon OpenSearch Service domain and write failed documents to an S3 backup bucket in the Security account.Cevap
- BConfigure the CloudWatch agent on the EC2 instances with the log path set to `/var/log/app/transaction.log` to track the active log stream. Send the logs to a local CloudWatch log group. In the Security account, create a CloudWatch Logs destination resource pointing to a local Kinesis Data Firehose delivery stream, and attach an access policy allowing the Production account to publish to it. In the Production account, create a CloudWatch Logs subscription filter on the log group pointing to the Security account's destination ARN. Configure the Kinesis Data Firehose stream to deliver logs to the Amazon OpenSearch Service domain and write failed logs to an S3 backup bucket in the Security account.
- CConfigure the CloudWatch agent on the EC2 instances with the log path set to `/var/log/app/transaction.log*` and configure the agent to publish logs directly to a Kinesis Data Firehose delivery stream in the Security account. Create an IAM role in the Production account that attempts to assume a role in the Security account to write directly to Firehose, but do not configure any CloudWatch log groups in the Production account to act as a buffer or local log cache.
- DConfigure the CloudWatch agent on the EC2 instances with the log path set to `/var/log/app/transaction.log*` and publish logs to a local CloudWatch log group in the Production account. Create a Kinesis Data Firehose delivery stream in the Production account that delivers logs directly to the Amazon OpenSearch Service domain in the Security account. Configure Kinesis Data Firehose to write failed documents to an S3 bucket in the Security account, and apply a bucket policy that grants `s3:PutObject` to the Production account IAM role but omits the `s3:PutObjectAcl` permission required to grant bucket owner full control.