An enterprise runs a critical trading application on Amazon EC2 instances in an Auto Scaling group. The application writes transaction logs directly to a local directory `/var/log/trading/`. Due to high transaction volumes, the application does not write to a static file; instead, it writes directly to new hourly log files named in the format `/var/log/trading/trade_YYYYMMDD_HH.log` (for example, `/var/log/trading/trade_20260716_11.log`).
A solutions architect must design a centralized logging solution to stream these logs to Amazon CloudWatch Logs, and then forward them to an Amazon S3 bucket in a centralized security account () using Amazon Kinesis Data Firehose. The solution must ensure that log delivery is continuous, handles the hourly file creation without missing data, and respects the principle of least privilege.
Which configuration strategy must the solutions architect implement to meet these requirements?
- AConfigure the CloudWatch agent on the EC2 instances with the log path set to `/var/log/trading/trade_*.log`. In the security account (), configure the S3 bucket policy to grant `s3:PutObject` and `s3:GetBucketLocation` permissions to the AWS service principal `firehose.amazonaws.com` with a condition pattern matching the application account ID.
- Configure the CloudWatch agent on the EC2 instances with the log path set to `/var/log/trading/trade_*.log`. In the security account (), configure the S3 bucket policy to grant `s3:PutObject` and `s3:GetBucketLocation` permissions to the ARN of the IAM role assumed by the Kinesis Data Firehose delivery stream in the application account.Answer
- CConfigure the CloudWatch agent on the EC2 instances with the log path set to `/var/log/trading/trade.log`. In the security account (), configure the S3 bucket policy to grant `s3:PutObject` and `s3:GetBucketLocation` permissions to the ARN of the IAM role assumed by the Kinesis Data Firehose delivery stream in the application account.
- DConfigure the CloudWatch agent on the EC2 instances with the log path set to `/var/log/trading/trade.log`. In the security account (), configure the S3 bucket policy to grant `s3:PutObject` and `s3:GetBucketLocation` permissions to the AWS service principal `firehose.amazonaws.com` with a condition pattern matching the application account ID.