Convert RDS storage autoscaling events into a CloudWatch custom metric with EventBridge and Lambda for the dashboard

Answer Correct answer: A — use an EventBridge rule on RDS autoscaling events and a Lambda that publishes a CloudWatch custom metric for the dashboard.

A company has configured Amazon RDS storage autoscaling for its RDS DB instances. A DevOps team needs to visualize the autoscaling events on an Amazon CloudWatch dashboard. Which solution will meet this requirement?

  1. Create an Amazon EventBridge rule that reacts to RDS storage autoscaling events from RDS events. Create an AWS Lambda function that publishes a CloudWatch custom metric. Configure the EventBridge rule to invoke the Lambda function. Visualize the custom metric by using the CloudWatch dashboard. Correct Answer
  2. Create a trail by using AWS CloudTrail with management events configured. Configure the trail to send the management events to Amazon CloudWatch Logs. Create a metric filter in CloudWatch Logs to match the RDS storage autoscaling events. Visualize the metric filter by using the CloudWatch dashboard.
  3. Create an Amazon EventBridge rule that reacts to RDS storage autoscaling events from the RDS events. Create a CloudWatch alarm. Configure the EventBridge rule to change the status of the CloudWatch alarm. Visualize the alarm status by using the CloudWatch dashboard.
  4. Create a trail by using AWS CloudTrail with data events configured. Configure the trail to send the data events to Amazon CloudWatch Logs. Create a metric filter in CloudWatch Logs to match the RDS storage autoscaling events. Visualize the metric filter by using the CloudWatch dashboard.

Community Votes

A
85%
B
15%

85% of anonymous learners picked answer A. Votes are pick records left by other test-takers — they are not the verified answer.

Community Insight

RDS storage autoscaling events are delivered to EventBridge, so an EventBridge rule plus a Lambda that emits a CloudWatch custom metric is the direct path to a dashboard metric (A). Options B and D both rely on CloudTrail, but autoscaling events are not CloudTrail API-call records for these storage changes, so a metric filter would never match. Option C is also flawed because a CloudWatch alarm cannot be the target of an EventBridge rule; EventBridge targets are limited to services such as Lambda, SNS, SQS, Step Functions, ECS, and Events, and an alarm's status cannot be changed that way.

Amazon RDS publishes storage autoscaling events through Amazon EventBridge, not through CloudTrail, so the dashboard must be fed from those events. An EventBridge rule reacting to RDS storage autoscaling events invokes an AWS Lambda function that publishes a CloudWatch custom metric, and that custom metric is then visualized on the CloudWatch dashboard. This converts the autoscaling event stream into a metric the dashboard can chart.

Creating a CloudTrail trail with management or data events and a metric filter for autoscaling events (B and D) — auxwww noted that autoscaling operations are not logged by CloudTrail in a way that a metric filter would match, since RDS storage autoscaling surfaces as an EventBridge event rather than an API call record. Pointing the EventBridge rule at a CloudWatch alarm to change its status (C) — an EventBridge rule cannot target a CloudWatch alarm, so this wiring does not exist.

Community Discussion (6 comments)

spring21 👍 2 Selected: A
AWS CloudTrail does log autoscaling operations by capturing API calls made to the Auto Scaling service, meaning all actions related to scaling your EC2 instances, including scaling up, down, or adjusting scaling policies, will be recorded in your CloudTrail logs.
auxwww 👍 4 Selected: A
B - Incorrect "Autoscaling operations aren't logged by AWS CloudTrail. For more information on CloudTrail, see Monitoring Amazon RDS API calls in AWS CloudTrail."
Shenannigan 👍 3 Selected: B
This question is tricky as both A and B are correct If it said in near real time then I would have chosen A, but it didn't so I am saying B as it is less complex and doesn't require writing a lambda function to use custom metrics. Honestly on this question flip a coin and choose one or the other
jamesf 👍 4 Selected: A
keywords: - Amazon EventBridge rule - CloudWatch custom metric
trungtd 👍 4 Selected: A
While CloudTrail can capture RDS events and send them to CloudWatch Logs, creating a metric filter in CloudWatch Logs is more complex and indirect compared to using EventBridge and a Lambda function to publish custom metrics directly to CloudWatch.
tgv 👍 2
---> A

Comments & Corrections

No comments yet — spotted an error or have a note? Share it below.

Log in to comment, report an error, or add a note about this question.

Submitted for moderation before publishing. Keep it helpful and respectful.

Expert Analysis

Why the Answer Is Correct

Amazon RDS emits storage autoscaling events to Amazon EventBridge. Creating an EventBridge rule that matches those events and targets an AWS Lambda function, where the function publishes a CloudWatch custom metric capturing the autoscaling activity, converts the event stream into a metric. That custom metric can then be rendered as a widget on a CloudWatch dashboard, which is what the requirement asks for. This is the standard event-to-metric pattern for surfacing RDS events on a dashboard.

Why the Other Options Are Wrong

B creates a CloudTrail trail for management events, sends them to CloudWatch Logs, and builds a metric filter for the autoscaling events. RDS storage autoscaling is not captured as a CloudTrail management event in a form this metric filter would match, so nothing would be charted. D does the same thing with data events instead of management events, which is even less applicable since data events cover S3 object-level and similar data-plane operations, not RDS autoscaling. C creates an EventBridge rule targeting a CloudWatch alarm so the alarm's status changes, but an EventBridge rule cannot target a CloudWatch alarm; there is no such integration, so this design does not function. A is the correct answer.

Community Comment Notes

Community voted A (85), with B a 15 percent minority. auxwww explicitly noted that autoscaling operations are not logged by AWS CloudTrail, which is the decisive objection to B and D. Shenannigan observed that both A and B would work only if the question had specified near real time and otherwise preferred B for simplicity, but trungtd and jamesf countered that the metric-filter approach via CloudTrail is indirect and complex compared with the EventBridge plus Lambda custom metric path.

Official Reference

Related Analysis

Practice All DOP-C02 Questions

Access 85 questions with complete answers and detailed explanations.

View Full DOP-C02 Practice Test →

← Back to DOP-C02 Study Guide