ServiceNow CMDB CI relationship sync: faster, more complete →
Mods
ServiceNow

Policy: Azure > Compute > Virtual Machine > ServiceNow > Relationships > Template

This policy allows you to define and manage relationships in ServiceNow. The relationships you specify as a YAML list will be created for Azure > Compute > Virtual Machine resource in ServiceNow.

Example:

- type: 'Depends on::Used by' parent: name: Web Server sysId: 5a00600a97f81210f0e6f52ad053afb3 tableName: cmdb_ci_server - type: 'Hosted on::Hosts' child: name: Application Service sysId: 6f812105f3a00af52ad0e60a005fb397 tableName: cmdb_ci_service where parent is the resource from which the relationship would be created, and child is the resource to which the the relationship would be created.

Resource Types

This policy targets the following resource types:

Primary Policy

This policy is used with the following primary policy:

Controls

Policy Specification

Schema Type
array
Default template
{% if $.virtualMachineScaleSet and $.virtualMachineScaleSet.metadata.serviceNow.sysId %}
- type: "Managed by::Manages"
parent:
name: {{ $.virtualMachineScaleSet.turbot.title }}
sysId: {{ $.virtualMachineScaleSet.metadata.serviceNow.sysId }}
tableName: {{ $.virtualMachineScaleSet.metadata.serviceNow.tableName }}
{% endif %}
{% if $.availabilitySet and $.availabilitySet.metadata.serviceNow.sysId %}
- type: "Managed by::Manages"
parent:
name: {{ $.availabilitySet.turbot.title }}
sysId: {{ $.availabilitySet.metadata.serviceNow.sysId }}
tableName: {{ $.availabilitySet.metadata.serviceNow.tableName }}
{% endif %}
Default template input
- |
{
resource {
virtualMachineScaleSet: get(path: "virtualMachineScaleSet")
availabilitySet: get(path: "availabilitySet")
}
}
- |
{
virtualMachineScaleSet: resource(id: "azure://{{ $.resource.virtualMachineScaleSet.id | lower }}", options: {notFound: RETURN_NULL}) {
metadata
turbot {
title
}
}
availabilitySet: resource(id: "azure://{{ $.resource.availabilitySet.id | lower }}", options: {notFound: RETURN_NULL}) {
metadata
turbot {
title
}
}
}

Category

In Your Workspace

Developers