Skip to content

feat(rds): emit aws.rds EventBridge events on lifecycle ops#735

Merged
vieiralucas merged 2 commits intomainfrom
worktree-integrations-batch1-rds-eventbridge
Apr 24, 2026
Merged

feat(rds): emit aws.rds EventBridge events on lifecycle ops#735
vieiralucas merged 2 commits intomainfrom
worktree-integrations-batch1-rds-eventbridge

Conversation

@vieiralucas
Copy link
Copy Markdown
Member

@vieiralucas vieiralucas commented Apr 24, 2026

Summary

Closes the first gap from the integrations audit: RDS now emits aws.rds events on the default EventBridge bus when DB instances and snapshots transition state, matching the AWS event schema. Rules can match on source/detail-type and route to SQS, SNS, Lambda, or any supported target.

Events emitted:

Operation EventID
CreateDBInstance RDS-EVENT-0005
DeleteDBInstance RDS-EVENT-0003
ModifyDBInstance RDS-EVENT-0014
RebootDBInstance RDS-EVENT-0006
StartDBInstance RDS-EVENT-0088
StopDBInstance RDS-EVENT-0089
CreateDBInstanceReadReplica RDS-EVENT-0005
RestoreDBInstanceFromDBSnapshot RDS-EVENT-0043
CreateDBSnapshot RDS-EVENT-0042
DeleteDBSnapshot RDS-EVENT-0041

Test plan

  • Unit tests in crates/fakecloud-rds/src/service.rs cover the emit path with a recording EventBridgeDelivery mock
  • E2E tests in crates/fakecloud-e2e/tests/rds_eventbridge.rs exercise StartDBInstance / StopDBInstance through real EB rule matching to an SQS target (no docker required, runs on every CI shard)
  • cargo clippy --workspace --all-targets -- -D warnings clean
  • cargo fmt --check clean
  • Existing RDS E2E suite still green

Summary by cubic

RDS now emits aws.rds EventBridge events for DB instance and snapshot lifecycle operations, matching the AWS event schema. Rules on the default bus can route to SQS, SNS, Lambda, and other targets; SNS delivery via rules is now wired and tested.

  • New Features
    • Emits events for: Create/Delete/Modify/Reboot/Start/Stop DB instance; Create/Delete snapshot; Create read replica; Restore from snapshot (EventIDs: 0005, 0003, 0014, 0006, 0088, 0089, 0042, 0041, 0043).
    • Wired RdsService to a DeliveryBus that forwards to EventBridge and downstream SQS/SNS targets (no-op when not configured); added E2E tests (Start/Stop -> SQS, Start -> SNS) and unit tests with a recording delivery; updated RDS and integration docs.

Written for commit 174a8a3. Summary will update on new commits.

DB instance and snapshot lifecycle ops now emit `aws.rds` events on
the default EventBridge bus, matching the AWS event schema. EventBridge
rules can match on source/detail-type and route to SQS, SNS, Lambda, or
any other supported target.

Wired ops:
- CreateDBInstance         -> RDS-EVENT-0005
- DeleteDBInstance         -> RDS-EVENT-0003
- ModifyDBInstance         -> RDS-EVENT-0014
- RebootDBInstance         -> RDS-EVENT-0006
- StartDBInstance          -> RDS-EVENT-0088
- StopDBInstance           -> RDS-EVENT-0089
- CreateDBInstanceReadReplica -> RDS-EVENT-0005 (read replica)
- RestoreDBInstanceFromDBSnapshot -> RDS-EVENT-0043
- CreateDBSnapshot         -> RDS-EVENT-0042
- DeleteDBSnapshot         -> RDS-EVENT-0041

Closes the gap noted in the integrations audit: RDS captured ops but
never emitted the corresponding `aws.rds` events real AWS users rely on
for downstream automation.
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 24, 2026

Codecov Report

❌ Patch coverage is 61.38614% with 78 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
crates/fakecloud-rds/src/service.rs 71.00% 49 Missing ⚠️
crates/fakecloud-rds/src/extras.rs 18.18% 18 Missing ⚠️
crates/fakecloud-server/src/main.rs 0.00% 11 Missing ⚠️

📢 Thoughts on this report? Let us know!

Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 7 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="crates/fakecloud-server/src/main.rs">

<violation number="1" location="crates/fakecloud-server/src/main.rs:1681">
P2: RDS EventBridge delivery is wired without an SNS sender, so SNS rule targets for `aws.rds` events are never delivered.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

Comment thread crates/fakecloud-server/src/main.rs Outdated
Cubic flagged that the inner DeliveryBus passed to the RDS-side
EventBridge dispatcher only had SQS, so `aws.rds` events targeting an
SNS topic via an EB rule never got published. Adds the SNS sender
clone and an SNS-target E2E test to lock in the behavior.
@vieiralucas vieiralucas merged commit 5466717 into main Apr 24, 2026
48 checks passed
@vieiralucas vieiralucas deleted the worktree-integrations-batch1-rds-eventbridge branch April 24, 2026 21:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant