Resources and Relationships

How Knowledge Tree represents infrastructure as resource nodes and typed relationship edges in the knowledge graph.

Resources

Every discovered object is a resource. Resources are stored as labeled nodes in the knowledge graph with a set of properties. Each resource has a globally unique ID, a type in dotted notation, and key-value properties.

Resource Fields

FieldDescriptionExample
idGlobally unique identifieraws:ec2:us-east-1:123:i-abc123
typeDotted resource typeaws.ec2.instance
nameHuman-readable nameprod-api-server
providerCloud provideraws, azure, gcp, kubernetes
regionGeographic regionus-east-1, europe-west1
account_idAccount/project ID123456789012
propertiesKey-value attributesstate: running, instance_type: m5.large
tagsUser-defined labelsenv:prod, team:platform
raw_dataFull provider JSONPreserved for detailed inspection

Resource Types

Resource types follow a provider.service.resource naming convention. Knowledge Tree recognizes types across four providers:

AWS

aws.ec2.instance        aws.rds.instance       aws.s3.bucket
aws.lambda.function     aws.eks.cluster        aws.elb.load_balancer
aws.vpc                 aws.subnet             aws.nat_gateway
aws.sqs.queue           aws.sns.topic          aws.dynamodb.table
aws.elasticache.cluster aws.iam.role           aws.iam.policy
aws.cloudfront.distribution aws.apigateway.rest_api

Azure

azure.compute.virtual_machine   azure.sql.database
azure.web.app_service           azure.web.function_app
azure.containerservice.managed_cluster
azure.storage.account           azure.network.virtual_network
azure.network.load_balancer     azure.keyvault.vault

GCP

gcp.compute.instance     gcp.cloudsql.instance   gcp.storage.bucket
gcp.container.cluster    gcp.run.service         gcp.compute.network
gcp.pubsub.topic         gcp.bigquery.dataset    gcp.spanner.instance

Kubernetes

k8s.namespace           k8s.deployment          k8s.service
k8s.pod                 k8s.ingress             k8s.config_map
k8s.secret              k8s.persistent_volume_claim
k8s.daemon_set          k8s.stateful_set        k8s.cron_job
Custom Resource Types
Custom discovery plugins can emit any resource type following the dotted notation. Unknown types are stored with provider set to "unknown" and are still fully queryable.

Relationships

Relationships connect resources as typed, directed edges in the graph. They represent how resources depend on, connect to, or contain each other.

Relationship Types

TypeDescriptionExample
DEPENDS_ONRuntime dependencyService depends on a database
CONNECTS_TONetwork connectionApp connects to a cache endpoint
ROUTES_TOTraffic routingIngress routes to a service
RUNS_ONExecution hostingPod runs on a node
EXPOSESPublic endpointLoad balancer exposes a service
OWNSOwnership/containmentVPC owns a subnet
CONTAINSPhysical containmentCluster contains a node pool

Properties

Resource properties are stored as key-value pairs prefixed withprop_ in the graph. For example, an EC2 instance would have prop_state, prop_instance_type,prop_private_ip, etc. These are fully searchable via Cypher queries.