I’m trying to separate data from different AWS accounts with Management Zones, so the best solution I found was to automatically tag all the hosts, processes and services that are in, let’s say Account A. I already tagged all the Hosts and underlying processes with the tag Environment = stg. However I’m struggling when trying to tag all the Services that run on those EC2 instances. I’ve been exploring the API querying a single Service I got something as the following:
{
"entityId": "SERVICE-ABCD123",
"type": "SERVICE",
"displayName": "MyService",
"firstSeenTms": 1702652961186,
"lastSeenTms": 1706119883592,
"properties": {
"serviceType": "WEB_SERVICE",
(...)
},
"tags": [],
"managementZones": [],
"icon": {
"primaryIconType": "web-sphere"
},
"fromRelationships": {
"calls": [
{
"id": "SERVICE-DCBA321",
"type": "SERVICE"
}
],
"runsOnHost": [
{
"id": "HOST-XYZ123",
"type": "HOST"
}
]
(...)
}
}
And regarding the Host is something like this:
{
"entityId": "HOST-XYZ123",
"type": "HOST",
"displayName": "MyHost.mydomain.org.me",
"firstSeenTms": 1702564195134,
"lastSeenTms": 1706119645611,
"properties": {
"bitness": "64",
"installerTrackedDownload": false,
"autoInjection": "ENABLED",
"additionalSystemInfo": [
{
"value": "Amazon EC2",
"key": "system.vendor"
},
(...)
],
"monitoringMode": "FULL_STACK",
"osArchitecture": "X86",
"osVersion": "Red Hat Enterprise Linux 8.9 (Ootpa) (kernel 4.18.0-513.9.1.el8_9.x86_64)",
"installerPotentialProblem": false,
"cloudType": "EC2",
"macAddresses": [
"12:37:37:2D:68:AB"
],
"osType": "LINUX",
"state": "RUNNING",
(...)
"installerSupportAlert": false
},
"tags": [
{
"context": "CONTEXTLESS",
"key": "Environment",
"value": "stg",
"stringRepresentation": "Environment:stg"
}
],
"managementZones": [],
}
(I ommited non-relevant info with (…))
Following my logic it should be something like
type(SERVICE),fromRelationships.runsOn(type(HOST).tags(Environment=stg))
Since “tags” is at the same level as type in the json. I’m not completely sure about the “=” sign to show which values of that tag I’m interested in. However, the Entity Selector doesn’t seem to understand what I’m trying to query since it doesn’t understand the “.tags” part.I’ve tried with
type(SERVICE),fromRelationships.runsOn(type(HOST).tags(Environment))
but no success at all. Could someone guide me on how to achieve this?


