AWS Certified Solutions Architect Professional SAP-C02 Practice Question
A global e-commerce company runs a microservices application on Amazon ECS and AWS Lambda across multiple AWS accounts (Production, Development, Staging) and in two AWS Regions (us-east-1, eu-west-1). The operations team is facing challenges in efficiently diagnosing production issues because application logs are fragmented across numerous CloudWatch Log Groups in different accounts and regions. To enhance operational excellence and reduce the Mean Time to Resolution (MTTR), they need a unified solution to centralize log data for correlation, analysis, and proactive alarming on application-wide error trends. Which strategy provides the MOST operationally excellent and scalable solution using Amazon CloudWatch and related services?
In each source account, create IAM roles that grant read-only access to the central operations account. In the central account, deploy a custom script on an EC2 instance that periodically uses 'sts:AssumeRole' to connect to each source account, retrieves logs using the 'FilterLogEvents' API call, and stores them in a central CloudWatch Log Group.
Designate a central logging account. In the central account, create a Kinesis Data Stream. In each source account and region, create CloudWatch Logs subscription filters for the required log groups, configured to send log data to the central Kinesis Data Stream. In the central account, use a Lambda function triggered by the Kinesis stream to forward logs to a centralized CloudWatch Log Group. Create metric filters on the central log group and build cross-account dashboards.
Establish a central logging account and enable CloudWatch cross-account observability, linking all source accounts to the central account. This will automatically share logs and metrics. In the central account, create metric filters based on the now-visible log groups from all source accounts and regions, and build unified dashboards.
Configure the CloudWatch agent on all EC2 instances and as an ECS sidecar to send logs directly to a CloudWatch Log Group in the central monitoring account. For Lambda functions, modify their IAM execution roles to grant 'logs:PutLogEvents' permission directly to the central account's log group.
The correct answer proposes a scalable, real-time, and decoupled architecture for centralizing logs. This approach uses a central Kinesis Data Stream as a destination for log events from multiple source accounts and regions. In each source account, a CloudWatch Logs subscription filter is used to push log events to the central stream. A Lambda function in the central account then consumes these logs from the stream and forwards them to a centralized CloudWatch Log Group. This enables unified analysis with CloudWatch Logs Insights, creation of metric filters for alarming, and consolidated visualization through cross-account dashboards. This 'push' model is highly scalable and considered a best practice for centralized logging.
The option suggesting a 'pull' model using a script on an EC2 instance to assume roles and fetch logs is less efficient. It is not real-time, can be complex to manage, and may encounter API throttling limits at scale. The solution proposing direct logging from the CloudWatch agent and Lambda functions to a central account's log group is not a standard or supported pattern; the CloudWatch agent requires credentials for cross-account logging, which is poor security practice, and Lambda functions natively log to their own account. The CloudWatch cross-account observability feature is a valid tool but is designed for linking a source account in one region to a monitoring account in the same region. It does not natively aggregate logs from multiple regions into a single, centralized location for unified querying, making it insufficient for this multi-region scenario.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What is a CloudWatch Logs subscription filter?
Open an interactive chat with Bash
What role does Amazon Kinesis Data Stream play in this solution?
Open an interactive chat with Bash
How do cross-account dashboards work in Amazon CloudWatch?
Open an interactive chat with Bash
AWS Certified Solutions Architect Professional SAP-C02
Continuous Improvement for Existing Solutions
Your Score:
Report Issue
Bash, the Crucial Exams Chat Bot
AI Bot
Loading...
Loading...
Loading...
Pass with Confidence.
IT & Cybersecurity Package
You have hit the limits of our free tier, become a Premium Member today for unlimited access.
Military, Healthcare worker, Gov. employee or Teacher? See if you qualify for a Community Discount.
Monthly
$19.99
$19.99/mo
Billed monthly, Cancel any time.
3 Month Pass
$44.99
$14.99/mo
One time purchase of $44.99, Does not auto-renew.
MOST POPULAR
Annual Pass
$119.99
$9.99/mo
One time purchase of $119.99, Does not auto-renew.
BEST DEAL
Lifetime Pass
$189.99
One time purchase, Good for life.
What You Get
All IT & Cybersecurity Package plans include the following perks and exams .