A retail enterprise operates a high-throughput transaction processing application deployed on a fleet of Amazon EC2 instances across 50 member accounts. The accounts are managed under a single organization in AWS Organizations. The application logs transaction events locally to `/var/log/transactions/app.log`. The files undergo hourly rotation by `logrotate` and are renamed to `/var/log/transactions/app.log-YYYYMMDD-HH`.
A Solutions Architect must design a centralized, near-real-time logging solution to aggregate these application logs into a single Amazon S3 bucket in a dedicated logging account. The solution must minimize log duplication, ensure no logs are lost during rotation, and avoid the administrative overhead of deploying streaming infrastructure in every member account.
Which two configurations should the Solutions Architect implement to meet these requirements?
- Configure the CloudWatch agent on the EC2 instances to monitor the exact log file path `/var/log/transactions/app.log` without using wildcards in the configuration.Cevap
- In the central logging account, create a Kinesis Data Firehose delivery stream and a CloudWatch Logs destination. Configure the destination policy to permit the `logs:PutSubscriptionFilter` action for the AWS Organization using the `aws:PrincipalOrgID` condition, and create subscription filters in the member accounts targeting this destination.Cevap
- CConfigure the CloudWatch agent on the EC2 instances to monitor the wildcard log path `/var/log/transactions/app.log*` to ensure that rotated log files are captured during the rotation window.
- DIn the central logging account, configure the S3 bucket policy to grant `s3:PutObject` permissions to a wildcard principal (`*`) restricted by the `aws:PrincipalOrgID` condition. In each member account, configure the CloudWatch agent to write logs directly to the central S3 bucket.
- EDeploy a Kinesis Data Firehose delivery stream in each member account. In the central logging account, configure the S3 bucket policy to grant `s3:PutObject` access to the principal `"arn:aws:iam::*:role/FirehoseDeliveryRole"` to allow all member accounts to deliver logs.