AWS cloud discovery in ServiceNow ITOM Visibility can run on a timetable, react to change notifications from AWS Config, or collect EC2 data through AWS Systems Manager agents. Each route asks for different credentials, agents and storage. Choose a route by the data you need, the access you can grant, and how fast a change must reach the CMDB.
How the main AWS discovery routes differ
The platform offers several collection routes, and the prerequisites change with each one. For the wider discovery setup, see the Discovery overview. The table lists the extra pieces each route asks for, beyond the AWS service account and permissions that schedule setup requires.
| Route | MID Server | AWS SSM agent on VMs | S3 bucket | Extra credential |
|---|---|---|---|---|
| Pattern-based cloud discovery | Required | Not needed | Not needed | None |
| Horizontal discovery with AWS SSM | Required | Required | Required | None |
| Service Graph Connectors | Not needed | Required | Required | Cloud credential |
| IP-based horizontal discovery | Required | Not needed | Not needed | OS credential |
Of the four routes in the table, only IP-based horizontal discovery offers top-down service mapping, and it is the route that needs an OS credential on each target. The cloud-level routes do not offer it. For the service mapping side of the platform, see service mapping.
Event-driven discovery keeps the CMDB current between scans
Events-driven discovery covers the gap between scheduled runs. When AWS Config detects a change in the lifecycle state or configuration of a resource, it sends a notification through Amazon Simple Notification Service to the ServiceNow Cloud Events REST API. The API writes that notification to the Cloud Event table if it qualifies.
Three kinds of message qualify:
- A subscription confirmation message.
- A configuration item change notification from AWS Config.
- A tag change on a configuration item, raised by Amazon CloudWatch.
Once an event is stored in the Ready state, the Cloud Event Scheduler picks it up in batches. Where a suitable response mapping exists, the scheduler uses it to create or update the configuration item. Where none exists, it starts the matching discovery pattern instead.
Prerequisites before you enable it
- The Discovery plugin is activated, and valid AWS service accounts with logical datacenters are already discovered.
- The user holds the discovery_admin and sn_cmp.cloud_event_integration roles.
- The AWS role can reach SNS and AWS Config, and each resource type you want to track.
- You have the Cloud Discovery patterns spreadsheet, which lists the permissions each pattern needs. New patterns arrive quarterly.
Event properties worth knowing
| Property | Default | What it controls |
|---|---|---|
| sn_cmp.cloud_event.use_response_mapping_aws | true | Whether a response mapping updates the CI when one is available. When it is not used, a discovery pattern runs. |
| sn_cmp.cloud_event.parallel_scheduler_count | 1 | How many Cloud Event Scheduler instances run in parallel. Raise it when event volume is high. |
| sn_cmp.error_events.default_domain | global | The domain sys_id that limits who can see failed events. Set it to the service-provider domain. |
During processing, the scheduler assigns each event the domain of its service account. If that step fails, the event can stay unassigned and visible across all domains, which is why the default domain setting matters.
Event pattern discovery is a separate path. Event patterns update Amazon AWS cloud component data in near real time. Application and network load balancer events, and classic load balancer events, both update the Cloud Load Balancer record.
SSM discovery collects EC2 data through AWS Systems Manager
SSM discovery is an agent-based route for Amazon EC2 instances. It does not need operating system credentials for each machine, nor Agent Client Collector or direct VPC access. The work is split between the platform, the MID Server and AWS services. For the MID Server’s role in general, see the MID Server guide.
- The platform sends discovery commands to the MID Server.
- The MID Server uses AWS Systems Manager, Simple Storage Service and Parameter Store to run those commands on target instances.
- SSM agents on the instances run the commands and write their results to an S3 bucket.
- The MID Server retrieves and processes those results.
- The MID Server returns the results through the ECC queue, and the platform updates the CMDB.
Limits and versions
SSM discovery does not support file-based, certificate-based or top-down discovery, Enhanced ADM, or the Change/Unchange user step in patterns. Privileged execution uses sudo, the default shell is sh, and alternate command or shell types are not supported. You need Cloud Discovery Workspace 1.7.1 or later, CMDB CI Class Models 1.74.0 or later, and Discovery and Service Mapping Patterns 1.27.0 or later.
AWS-side preparation
- IAM roles for read, write and list permissions, and EC2 roles that let instances interact with SSM.
- An S3 bucket. Command output is redirected there because SSM caps command output at 24,000 characters, and the bucket also moves files to instances.
- An optional customer-managed KMS key for SecureString credentials in Parameter Store, required when applicative credentials are used.
- The ServiceNow YAML documents for SSM, imported into each region where discovery runs.
Turning it on in the instance
SSM is off by default. The agent runs with root on Linux or SYSTEM on Windows, so any command sent through it can run with full system access. Two system properties control it: glide.discovery.enable_ssm and glide.discovery.ssm.enable_windows. Enabling the first does not switch on Windows, which needs the second as a separate decision.
To set a property, go to All, then System Properties, then All Properties, find it by name, enter true and confirm. The discovery_admin role is required. The AWS SSM capability must be present on the MID Server; the ALL capability includes it, while individual capability setups need it added by hand.
Root or non-root execution
The property mid.discovery.aws_ssm.linux.fallback_root_user defaults to false. Set to true, commands run as root with no extra setup. When it stays false, add a record to the AWS SSM Instance Users table naming the user who runs commands on each instance. The choice sets which account runs SSM commands on each Linux instance, so decide it deliberately.
Slow instances and the command wait
By default, the MID Server waits 30 seconds before checking whether a Server CI has been created for an EC2 instance. For slow instances, raise sn_itom_pattern.discover_aws_server_command_initial_wait_ms, which accepts any positive integer. The change needs sn_itom_pattern.aws_cloud_discovery_populate_server_ci set to true and Discovery and Service Mapping Patterns 1.35.1 or later.
What lands in the CMDB
The SSM Cloud Agents pattern creates a Cloud System Management Agent record, which extends Virtual Machine Object. Its cloud agent type is set to AWS SSM. Install status reads Installed or Absent, operational status reads Operational or Non-Operational, and resource type reads EC2Instance or ManagedInstance. A Runs on relationship links the agent to its Virtual Machine Instance. For how these records fit the wider CMDB, see the CMDB guide. For AWS GovCloud (US) accounts, the AWS service account needs a datacenter URL.
Scheduled discovery: setup and the datacenter model
A scheduled discovery populates the account on a timetable. For the general mechanics of schedules, see how discovery schedules work. Set it up in the Discovery Admin Workspace, which requires version 1.11.0 or later and the discovery_admin role. For the broader AWS connection, see the AWS integration guide. Confirm first that a validated MID Server with status Up, Cloud Management capability and reach to the target IP ranges is in place, with credentials for the service accounts.
Creating the schedule
- Open Workspaces, then Discovery Admin Workspace, then Schedules, and select New Discovery.
- Choose Cloud-based discovery, name the schedule and select AWS.
- Choose the MID Server: a cluster for failover and load balancing, an available MID Server selected at run time through an IAM role, or a validated, up MID Server with Cloud Management.
- Choose the cloud account, either an existing one or a new one with its name and ID.
- Choose how to access it. Assuming an IAM role requires a trust relationship from the MID Server’s account, and verification fails if the role or trust is missing. Permanent credentials use static access keys tied to an IAM user. For how credentials are named and stored, see connection and credential aliases.
- For an AWS management account, choose all member accounts or specific ones. Choose all regions or selected regions.
- Optionally add a server discovery schedule, using credentials for OS-level depth or the AWS Systems Manager method for agent-based depth.
- Choose a run mode and finish.
Datacenters decide what runs
From version 1.29.0 of Discovery and Service Mapping Patterns, a datacenter discovery pattern runs first and sorts each datacenter into one of three states. Active datacenters contain resources the service account can see. Passive datacenters contain none. The schedule ignores them only when the mid.cloud.discovery.sonar.discover_all_aws_datacenters MID Server property is set to false, which is not the default. Empty datacenters are ones where the resource explorer is unavailable or lacks permission; patterns still run against them.
The Refresh Datacenters flow still lists all regions. A new resource, or a datacenter that turns active, is covered without creating another schedule.
Frequently asked questions
Does event-driven discovery replace scheduled discovery? No. Event-driven discovery is designed to update the CMDB without waiting for a scheduled run. It works from AWS Config change notifications, so it covers the resource types you have set up to track.
Do I need a MID Server for each AWS discovery route? Not for every route. The Service Graph Connectors route does not need one, and the other three routes in the comparison table do.
Why does SSM discovery need an S3 bucket? Command output goes to S3 so results are not cut off by SSM’s 24,000-character output limit. The same bucket moves files to instances.
Can SSM discovery run on Windows instances straight away? No. Enabling the general SSM property does not switch on Windows. The Windows property is a separate decision, because Windows discovery runs as SYSTEM.