On versions prior to 11.2, Discovery did not support Multi-Cloud discovery. Some customers still want to scan their AWS hosts directly, which results in those hosts being deemed physical rather than virtual.
The pattern attached below should resolve this issue. I will explain the components of this pattern below:
The tree_path determines where in the Manage > Knowledge hierarchy the pattern appears. In the case below, you would find the pattern under "Custom" and it would be labelled AWS. Some customers may already have a place they put all of their custom patterns, so this may need to be modified to keep everything nicely organized.
tree_path := "Custom", "AWS";
This trigger means "If a host is created, or discovered again (confirmed), and the "vendor" attribute starts with "Amazon" (case insensitive), then the pattern will proceed:
on host := Host created, confirmed where vendor matches regex '(?i)^Amazon';
If a host is found matching that trigger condition, the pattern goes on to set the "virtual" attribute to true, and writes a debug log entry:
// Set the virtual flag based on the vendor starting with Amazon
host.virtual := true;
log.debug("Virtual flag set for host: %host.name%");
Note: There is no reason to use this pattern on version 11.2 and newer, as the Multi-Cloud discovery feature will handle the virtual attribute appropriately.