Policy types for @turbot/servicenow-gcp-run

GCP > Cloud Run > Service > ServiceNow

URI
tmod:@turbot/servicenow-gcp-run#/policy/types/serviceServiceNow
Targets

GCP > Cloud Run > Service > ServiceNow > Configuration Item

Synchronize the data for the GCP > Cloud Run > Service based on the policies GCP > Cloud Run > Service > ServiceNow > Configuration Item > *

The Configuration Item control is responsible for automatically synchronizing records in a designated ServiceNow table, maintaining an up-to-date reflection of the GCP > Cloud Run > Service information within the ServiceNow CMDB.

URI
tmod:@turbot/servicenow-gcp-run#/policy/types/serviceServiceNowConfigurationItem
Valid Value
[
"Skip",
"Check: Archived",
"Check: Deleted",
"Check: Sync",
"Enforce: Archived",
"Enforce: Deleted",
"Enforce: Sync",
"Enforce: Sync, archive on delete"
]
Schema
{
"type": "string",
"enum": [
"Skip",
"Check: Archived",
"Check: Deleted",
"Check: Sync",
"Enforce: Archived",
"Enforce: Deleted",
"Enforce: Sync",
"Enforce: Sync, archive on delete"
],
"example": [
"Skip"
],
"default": "Skip"
}

GCP > Cloud Run > Service > ServiceNow > Configuration Item > Record

The policy facilitates the accurate representation of cloud resource within the ServiceNow environment, ensuring that critical data is effectively mapped and managed. Attribute of an GCP > Cloud Run > Service is systematically mapped to a specific column in a ServiceNow table.

The policy allows enabling organizations to select and map only those attributes that are most relevant to their operational needs. It significantly reduces the manual effort involved in data transfer and minimizes the risk of errors, thereby enhancing the overall efficiency of data management.

URI
tmod:@turbot/servicenow-gcp-run#/policy/types/serviceServiceNowConfigurationItemRecord
Default Template Input
"{\n resource: service{\n data\n metadata\n turbot {\n akas\n id\n tags\n title\n }\n }\n}\n"
Default Template
"binary_authorization: {{ $.resource.data.binaryAuthorization | dump | safe }}\nclient: {{ $.resource.data.client | dump | safe }}\nclient_version: {{ $.resource.data.clientVersion | dump | safe }}\nconditions: {{ $.resource.data.conditions | dump | safe }}\ncontainers: {{ $.resource.data.template.containers | dump | safe }}\ncreator: {{ $.resource.data.creator | dump | safe }}\nencryption_key: {{ $.resource.data.template.encryptionKey | dump | safe }}\netag: {{ $.resource.data.etag | dump | safe }}\ngeneration: {{ $.resource.data.generation | dump | safe }}\ningress: {{ $.resource.data.ingress | dump | safe }}\nlabels: {{ $.resource.data.labels | dump | safe }}\nlaunch_stage: {{ $.resource.data.launchStage | dump | safe }}\nobserved_generation: {{ $.resource.data.observedGeneration | dump | safe }}\nproject: {{ $.resource.metadata.gcp.projectId | dump | safe }}\nreconciling: {{ $.resource.data.reconciling | dump | safe }}\nregion: {{ $.resource.metadata.gcp.regionName | dump | safe }}\nservice_name: {{ $.resource.data.name | dump | safe }}\nterminal_condition: {{ $.resource.data.terminalCondition | dump | safe }}\ntraffic: {{ $.resource.data.traffic | dump | safe }}\nuri: {{ $.resource.data.uri | dump | safe }}\nvolumes: {{ $.resource.data.template.volumes | dump | safe }}\n"
Schema
{
"type": "object"
}

GCP > Cloud Run > Service > ServiceNow > Configuration Item > Table Definition

This policy specifically allows users to define two key aspects: the name of the ServiceNow table where the GCP > Cloud Run > Service data will be stored, and the details of the columns used for archiving purposes.

URI
tmod:@turbot/servicenow-gcp-run#/policy/types/serviceServiceNowConfigurationItemTableDefinition
Default Template Input
[
"{\n serviceNowInstance: resources(filter: \"resourceTypeId:tmod:@turbot/servicenow#/resource/types/instance level:self limit:1\") {\n items {\n turbot {\n id\n }\n }\n }\n}\n",
"{\n tableDefinition: policyValues(filter: \"policyTypeId:tmod:@turbot/servicenow-gcp-run#/policy/types/serviceServiceNowTableDefinition resourceId:{{$.serviceNowInstance.items[0].turbot.id}} level:self\") {\n items {\n value\n }\n }\n applicationScope: policyValues(filter: \"policyTypeId:tmod:@turbot/servicenow#/policy/types/serviceNowApplicationScope resourceId:{{$.serviceNowInstance.items[0].turbot.id}} level:self\") {\n items {\n value\n }\n }\n}\n"
]
Default Template
"tableName: "{%- if $.applicationScope.items | length == 0 or $.tableDefinition.items | length == 0 %} {%- else %}{{$.applicationScope.items[0].value}}_{{$.tableDefinition.items[0].value.table.name | lower}}{% endif %}"\n"
Schema
{
"type": "object",
"additionalProperties": false,
"required": [
"tableName"
],
"properties": {
"tableName": {
"type": "string"
},
"archiveColumns": {
"type": "object"
}
}
}

GCP > Cloud Run > Service > ServiceNow > Table

Configure a Table for GCP > Cloud Run > Service resource type in ServiceNow via the GCP > Cloud Run > Service > ServiceNow > Table > * policies.

URI
tmod:@turbot/servicenow-gcp-run#/policy/types/serviceServiceNowTable
Valid Value
[
"Skip",
"Check: Configured",
"Enforce: Configured"
]
Schema
{
"type": "string",
"enum": [
"Skip",
"Check: Configured",
"Enforce: Configured"
],
"example": [
"Skip"
],
"default": "Skip"
}

GCP > Cloud Run > Service > ServiceNow > Table > Definition

The policy enables the definition of ServiceNow table properties, including its name and the base table from which it extends, and details the specific columns required for representing GCP > Cloud Run > Service data.

URI
tmod:@turbot/servicenow-gcp-run#/policy/types/serviceServiceNowTableDefinition
Schema
{
"type": "object",
"additionalProperties": false,
"required": [
"table",
"columns"
],
"properties": {
"table": {
"type": "object",
"required": [
"name"
],
"properties": {
"name": {
"type": "string",
"pattern": "^([0-9a-z_])+$"
},
"label": {
"type": "string"
},
"extendsTable": {
"type": "string",
"pattern": "^([0-9a-z_])+$"
}
}
},
"columns": {
"type": "array",
"description": "An array of columns with their mappings to the CMDB.",
"default": [],
"items": {
"type": "object",
"required": [
"name"
],
"properties": {
"name": {
"type": "string",
"description": "The name of the column in the table.",
"pattern": "^([0-9a-z_])+$"
},
"label": {
"type": "string",
"description": "The label for the column."
},
"type": {
"description": "The data type of the column.",
"type": "string"
},
"size": {
"type": "integer",
"description": "The length for data type."
}
}
}
}
},
"default": {
"table": {
"name": "guardrails_gcp_run_service",
"label": "GCP > Cloud Run > Service",
"extendsTable": "cmdb_ci"
},
"columns": [
{
"name": "binary_authorization",
"label": "Binary Authorization",
"type": "string",
"size": 1000
},
{
"name": "client",
"label": "Client"
},
{
"name": "client_version",
"label": "Client Version"
},
{
"name": "conditions",
"label": "Conditions",
"type": "string",
"size": 1000
},
{
"name": "containers",
"label": "Containers"
},
{
"name": "creator",
"label": "Creator"
},
{
"name": "encryption_key",
"label": "Encryption Key"
},
{
"name": "etag",
"label": "Etag",
"size": 1000
},
{
"name": "generation",
"label": "Generation"
},
{
"name": "ingress",
"label": "Ingress"
},
{
"name": "labels",
"label": "Labels",
"type": "string",
"size": 1000
},
{
"name": "launch_stage",
"label": "Launch Stage"
},
{
"name": "observed_generation",
"label": "Observed Generation"
},
{
"name": "project",
"label": "Project",
"type": "string"
},
{
"name": "reconciling",
"label": "Reconciling",
"type": "boolean"
},
{
"name": "region",
"label": "Region"
},
{
"name": "service_name",
"label": "Name"
},
{
"name": "terminal_condition",
"label": "Terminal Condition",
"type": "string",
"size": 1000
},
{
"name": "traffic",
"label": "Traffic",
"type": "string",
"size": 1000
},
{
"name": "uri",
"label": "URI"
},
{
"name": "volumes",
"label": "Volumes"
}
]
}
}