AWS Builder Center
Event-Based Discovery of AWS Resources

Event-Based Discovery of AWS Resources

Part 5 of 6: Near Real-Time CMDB Updates with AWS Config, EventBridge and SNS

Series: ServiceNow on AWS (9 articles)

  1. …
  2. 5
    Event-Based Discovery of AWS Resources This article

How to read this guide: Most of this document is descriptive. Step-by-step instructions appear only where you change a default behavior or configuration; those sections are marked “Step-by-step”. Product menus and table names reflect recent ServiceNow releases (Xanadu/Yokohama/Zurich) and the Service Graph Connector for AWS v2.x. Always confirm them against your instance version. This is one part of a six-part series; read Part 1 first, as it explains the Service Graph Connector, the CMDB data model, and the RTE and IRE engines referred to here.
The series
Part 1: Core Guide — Service Graph Connector, Data Model and IRE
Part 2: CSDM, Tag-Based Mapping and Ticket Routing
Part 3: Extending the Service Graph Connector for IAM
Part 4: Pattern-Based Discovery and Comparison with the Service Graph Connector
Part 5: Near Real-Time CMDB Updates with AWS Config, EventBridge and SNS (this document)
Part 6: Governance and Additional Tools
What this document covers
1. Event-based discovery
Appendix: References



Contents



1. Event-Based Discovery (AWS Config, EventBridge/CloudWatch Events, SNS)

Scheduled discovery is always somewhat behind: the CMDB is accurate only until the next change. Event-based discovery fixes this. When AWS detects a change, it sends an event to ServiceNow, and ServiceNow updates just the affected CI within seconds. Event-based discovery is a feature of ServiceNow Cloud Discovery / Cloud Provisioning and Governance. It complements scheduled imports; it does not replace them.

1.1 How it works

1. AWS detects the change. AWS Config records a new configuration item (for example an instance launched, a security group rule changed, or a tag edited). Alternatively, Amazon EventBridge (formerly CloudWatch Events) matches an API or state-change event, for example an EC2 state-change notification or a CloudTrail API call.
2. AWS sends the event. Config publishes a *ConfigurationItemChangeNotification* to an SNS topic, or an EventBridge rule targets that SNS topic (or an API destination). An EventBridge rule in each member account can forward events to a central event bus, which simplifies multi-account setups.
3. ServiceNow receives it. An HTTPS SNS subscription points to the ServiceNow cloud-event endpoint. The first message is a *SubscriptionConfirmation*, which ServiceNow confirms automatically. After that, events arrive in the Cloud Events table ( sn_cmp_cloud_event ) with the state *Ready*.
4. The Cloud Event Scheduler processes the event. It applies a lightweight response mapping that updates the CI directly from the event payload (the fast path). If no mapping exists, it runs a targeted discovery pattern for just that resource.
5. The CMDB updates through IRE. The CI, its relationships, and its tags are created, updated, or marked retired.

1.2 What is configured where

Side
Components
AWS
AWS Config recorder and delivery channel in each Region; SNS topic with a policy that lets Config / EventBridge publish; optional EventBridge rules (in member accounts, forwarding to a central bus); an HTTPS subscription to the ServiceNow endpoint.
ServiceNow
Cloud Provisioning and Governance / Cloud Discovery plugins; Cloud Service Accounts (master plus members, cross-account roles); Cloud Event Scheduler (for example the property  sn_cmp.cloud_event.use_response_mapping_aws = true , and the parallel scheduler count); Cloud Event Subscriptions for each account; optional custom response mappings.


1.3 Best practices

• Keep a scheduled baseline. Run a daily or weekly full SGC or Discovery run to catch any events that were missed and to reconcile deletions.
• Limit noise. Record only the Regions and resource types you need, and filter EventBridge rules to the events that matter.
• Scale the scheduler when changes are frequent, and monitor the Cloud Events table for *Failed* events (often caused by missing IAM permissions or a missing response mapping or pattern).
• Use tags to control behavior. For example, a  servicenow-exclude=true  tag can be used to skip ephemeral resources.
• Note: event-based discovery is part of the Cloud Discovery (MID/pattern) stack. SGC itself is schedule-driven. Many customers combine SGC for scheduled bulk coverage with events for near-real-time changes to critical resource types.

Appendix: References

Topic
Link
IRE
servicenow.com/docs/r/servicenow-platform/configuration-management-database-cmdb/ire.html
Event-based cloud discovery (community)
servicenow.com/community/itom-forum/event-based-cloud-discovery-in-servicenow-real-time-aws/m-p/3459366
AWS Config supported resource types
docs.aws.amazon.com/config/latest/developerguide/resource-config-reference.html

Series: ServiceNow on AWS (9 articles)

  1. …
  2. 5
    Event-Based Discovery of AWS Resources This article
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article