An enterprise runs a critical microservices application deployed on Amazon EC2 instances in an Auto Scaling group across multiple member accounts in an AWS Organizations organization. The application is configured to write logs directly to dynamically named, hourly files based on a timestamp pattern (for example, `/var/log/microservice/api-2026-07-16-11.log`). The company wants to implement continuous, real-time log collection using the unified Amazon CloudWatch agent installed on the instances. The log streams are then forwarded from CloudWatch Logs via subscription filters to Amazon Kinesis Data Firehose in each member account, which must deliver the logs to a centralized Amazon S3 bucket in a dedicated logging account. A Solutions Architect observes two issues: 1. Log delivery stops after the first hour of instance execution, and logs in the newly generated files are not sent to CloudWatch Logs. 2. Even when logs are written to CloudWatch Logs, Kinesis Data Firehose is unable to deliver them to the centralized S3 bucket, resulting in delivery failures. Which combination of actions will resolve the logging issues and ensure continuous, centralized log delivery?
- AConfigure the CloudWatch agent's `file_path` as `/var/log/microservice/api.log` with the `log_rotation` option set to true. Update the S3 bucket policy in the centralized logging account to allow `s3:PutObject` actions, but omit the principal block to let any AWS Organizations member account write to it automatically.
- Configure the CloudWatch agent's `file_path` as `/var/log/microservice/api-*.log` to match the dynamically generated log files. Update the centralized S3 bucket policy to grant `s3:PutObject` permissions to the Kinesis Data Firehose IAM roles in the member accounts, using the `aws:PrincipalOrgID` condition to restrict access to the organization.Answer
- CConfigure the CloudWatch agent's `file_path` as `/var/log/microservice/api.log` to monitor the logs. Update the centralized S3 bucket policy to allow the member accounts' Kinesis Data Firehose IAM roles to write to the bucket, and configure the bucket to use the default AWS-managed KMS key (`aws/s3`) for encryption.
- DConfigure the CloudWatch agent's `file_path` as `/var/log/microservice/api-*.log` to capture the log files. Attach an IAM policy with `s3:PutObject` permissions directly to the member accounts' Kinesis Data Firehose IAM roles, without modifying the centralized S3 bucket policy, relying on role delegation instead.