For the Super Mario World topology map example:
Search the public repository of the exchange for "mario" and you should see a package called "Super Mario TopologySource Example". Go ahead and install it. There are two parts: a DataSource and a TopologySource. You'll need to modify the AppliesTo of both to point to a single device in your infrastructure. This can be a collector or if you are monitoring LogicMonitor from LogicMonitor, that's an option as well. Since the goal is to discover individual VPCs and the devices in them, you might want to eventually apply them to multiple devices, one in each VPC, for segregation purposes. Let's look at how this static version works and then how it could be adapted to pull in dynamic data from AWS.
The DataSource will create instances under that device for each world in Super Mario. Each of those instances has a unique identifier that is set on the instance when it is created. This is all the DataSource does, it doesn't actually do anything for collection. The DS does this by means of an active discovery script that outputs the list of worlds. For each world, it lists the unique identifier (wildvalue), display name (wildalias), a description (which isn't strictly necessary), and some properties. Included in those properties are two "predef." properties: predef.externalResourceID and predef.externalResourceType. The externalResourceID is the ERI and is the ID that the topology source will use to tie objects together. We'll look at that next. The externalResourceType just determines what icon will display on the map for that object.
Now that the instances are created, we can tie them together using the TopologySource. Once again, the relationships between objects is static. The TS simply outputs which ERIs are connected to which other ERIs.
Once the DS creates the instances and the TS maps them together, what you get is this, a mapping between the instances, showing which worlds have exits to which other worlds. This is the map that is automatically generated on the instance level, configured to show 2 degrees away.
Then, you can create a larger map including all the instances, to see the map of the entire set of worlds.
How does this relate to AWS VPCs and objects in those VPCs? Well, think about it this way:
What if the DataSource, instead of outputting the static names of the Mario worlds, queried some system that had the list of VPCs. It could then create those VPCs as instances under some device somewhere. If your AWS is being monitored by LogicMonitor, you could pretty easily write some code to query the API to get the list of those VPCs. The DS would need to create them with ERIs and ERTs, just like in the Mario example. You could write a pretty simple PropertySource to make sure that each device monitored in your AWS environment has ERIs and ERTs.
Then you could write a TopologySource to map the VPC instances to the AWS devices in which they reside.
Currently, the Mario active discovery output looks like this:
Yellow_Switch_Palace##Yellow Switch Palace##Yoshi's Island####auto.world=Yoshi%27s+Island&predef.externalResourceID=Yellow_Switch_Palace&predef.externalResourceType=SMWExit
Yoshi_s_House##Yoshi's House##Yoshi's Island####auto.world=Yoshi%27s+Island&predef.externalResourceID=Yoshi_s_House&predef.externalResourceType=SMWExit
Yoshi_s_Island_1##Yoshi's Island 1##Yoshi's Island####auto.world=Yoshi%27s+Island&predef.externalResourceID=Yoshi_s_Island_1&predef.externalResourceType=SMWExit
Yoshi_s_Island_2##Yoshi's Island 2##Yoshi's Island####auto.world=Yoshi%27s+Island&predef.externalResourceID=Yoshi_s_Island_2&predef.externalResourceType=SMWExit
Yoshi_s_Island_3##Yoshi's Island 3##Yoshi's Island####auto.world=Yoshi%27s+Island&predef.externalResourceID=Yoshi_s_Island_3&predef.externalResourceType=SMWExit
Yoshi_s_Island_4##Yoshi's Island 4##Yoshi's Island####auto.world=Yoshi%27s+Island&predef.externalResourceID=Yoshi_s_Island_4&predef.externalResourceType=SMWExit
Iggy_s_Castle##Iggy's Castle##Yoshi's Island####auto.world=Yoshi%27s+Island&predef.externalResourceID=Iggy_s_Castle&predef.externalResourceType=SMWExit
Green_Switch_Palace##Green Switch Palace##Donut Plains####auto.world=Donut+Plains&predef.externalResourceID=Green_Switch_Palace&predef.externalResourceType=SMWExit
Donut_Plains_1##Donut Plains 1##Donut Plains####auto.world=Donut+Plains&predef.externalResourceID=Donut_Plains_1&predef.externalResourceType=SMWExit
------------------ OUTPUT TRUNCATED ------------------
The output from the TopologySource looks like this:
{
"edges": [
{"from": "yoshi_s_island_1", "to": "yoshi_s_house", "type": "path"},
{"from": "yoshi_s_island_2", "to": "yoshi_s_house", "type": "path"},
{"from": "yoshi_s_house", "to": "yoshi_s_island_2", "type": "path"},
{"from": "yoshi_s_house", "to": "yoshi_s_island_1", "type": "path"},
{"from": "star_world_5", "to": "front_door", "type": "path"},
{"from": "yoshi_s_island_1", "to": "yellow_switch_palace", "type": "Normal"},
{"from": "yoshi_s_island_2", "to": "yoshi_s_island_3", "type": "Normal"},
{"from": "yoshi_s_island_3", "to": "yoshi_s_island_4", "type": "Normal"},
{"from": "yoshi_s_island_4", "to": "iggy_s_castle", "type": "Normal"},
============= OUTPUT TRUNCATED =============
{"from": "star_world_2", "to": "star_world_3", "type": "Secret"},
{"from": "star_world_3", "to": "star_world_4", "type": "Secret"},
{"from": "star_world_4", "to": "star_world_5", "type": "Secret"},
{"from": "star_world_5", "to": "gnarly", "type": "Secret"},
{"from": "gnarly", "to": "tubular", "type": "Normal"},
{"from": "tubular", "to": "way_cool", "type": "Normal"},
{"from": "way_cool", "to": "awesome", "type": "Normal"},
{"from": "awesome", "to": "groovy", "type": "Normal"},
{"from": "groovy", "to": "mondo", "type": "Normal"},
{"from": "mondo", "to": "outrageous", "type": "Normal"},
{"from": "outrageous", "to": "funky", "type": "Normal"}
]
}
You could change the instance discovery script to look like this:
VPC_A##VPC A######predef.externalResourceID=VPC_A&predef.externalResourceType=VPC
VPC_B##VPC B######predef.externalResourceID=VPC_B&predef.externalResourceType=VPC
VPC_C##VPC C######predef.externalResourceID=VPC_C&predef.externalResourceType=VPC
VPC_D##VPC D######predef.externalResourceID=VPC_D&predef.externalResourceType=VPC
VPC_E##VPC E######predef.externalResourceID=VPC_E&predef.externalResourceType=VPC
VPC_F##VPC F######predef.externalResourceID=VPC_F&predef.externalResourceType=VPC
VPC_G##VPC G######predef.externalResourceID=VPC_G&predef.externalResourceType=VPC
VPC_H##VPC H######predef.externalResourceID=VPC_H&predef.externalResourceType=VPC
And the TopologySource output would look like this:
{
"edges": [
{"from": "VPC_A", "to": "Device_A1", "type": "path"},
{"from": "VPC_A", "to": "Device_A2", "type": "path"},
{"from": "VPC_A", "to": "Device_A3", "type": "path"},
{"from": "VPC_A", "to": "Device_A4", "type": "path"},
{"from": "VPC_A", "to": "Device_A5", "type": "path"},
{"from": "VPC_A", "to": "Device_A6", "type": "path"},
{"from": "VPC_A", "to": "Device_A7", "type": "path"},
{"from": "VPC_B", "to": "Device_B1", "type": "path"},
{"from": "VPC_B", "to": "Device_B2", "type": "path"},
{"from": "VPC_B", "to": "Device_B3", "type": "path"},
{"from": "VPC_B", "to": "Device_B4", "type": "path"},
{"from": "VPC_C", "to": "Device_C1", "type": "path"},
{"from": "VPC_C", "to": "Device_C2", "type": "path"},
{"from": "VPC_C", "to": "Device_C3", "type": "path"},
============== OUTPUT TRUNCATED ==============
]
}
The only real trick is actually querying some system that knows the names of each of the VPCs, adding ERIs to the devices, and querying some system that knows the relationships between them.
Btw, if you haven't added yourcompany.logicmonitor.com as a device in your portal, I highly recommend it. It can be a great place to put this kind of stuff, rather than associating it with a particular collector or some other random device (although that is always an option).