Connecting Amazon Q Business to ServiceNow using AWS CloudFormation
You use the AWS::QBusiness::DataSource
resource to connect a data source to
your Amazon Q application.
Use the configuration
property to provide a JSON or YAML schema with the necessary
configuration details specific to your data source connector.
To learn more about AWS CloudFormation, see What is AWS CloudFormation? in the AWS CloudFormation User Guide.
Topics
ServiceNow configuration properties
The following provides information about important configuration properties required in the schema.
Configuration | Description | Type | Required |
---|---|---|---|
|
Configuration information for the endpoint for the data source. |
This property has the following sub-property: |
Yes |
|
The endpoint information for the data source. |
This property has the following sub-property: |
Yes |
|
The ServiceNow host URL. For example,
your-domain.service-now.com . |
|
Yes |
|
The type of authentication you are using, either basicAuth or
OAuth2 . |
|
Yes |
|
The ServiceNow version you are using. You can choose between Tokyo ,
San Diego , Rome , Vancouver , and Others . |
|
Yes |
|
Configuration information for the content of the data source. For example, configuring specific types of content and field mappings. | ||
|
A list of ServiceNow objects that Amazon Q crawls and maps the attributes of to Amazon Q index field names. |
This property has the following sub-properties: |
Yes |
|
The field name of your ServiceNow pages and assets. |
|
Yes |
|
The field type of your ServiceNow pages and assets. |
The allowed values are |
Yes |
|
The data source field name of your ServiceNow pages and assets. |
|
Yes |
|
The date format of your ServiceNow pages and assets. |
Specify the date format in the form |
No |
|
Additional configuration options for your content in your data source. |
This property has the following sub-properties.
|
Yes |
|
Specify the file size limit in MBs that Amazon Q will crawl. Amazon Q will crawl only the files within the size limit you define. The default file size is 50MB. The maximum file size should be greater than 0MB and less than or equal to 50MB. |
|
No |
|
Specify specific knowledge articles, incident queries, and service catalog queries to crawl. |
|
No |
|
Specify incidents to crawl by state type: whether Open , Open -
Unassigned , Resolved , or All . |
|
No |
|
A list of regular expression patterns to include and exclude specific files in your ServiceNow data source. Files that match the patterns are included in the index. Files that don't match the patterns are excluded from the index. If a file matches both an inclusion and exclusion pattern, the exclusion pattern takes precedence and the file isn't included in the index. |
|
No |
|
A list of regular expression patterns to exclude specific content in your ServiceNow data source. Content that matches the patterns are excluded from the index. Content that doesn't match the patterns are included in the index. If any content matches both an inclusion and exclusion pattern, the exclusion pattern takes precedence, and the content isn't included in the index. |
|
No |
|
A list of regular expression patterns to include specific content in your ServiceNow data source. Content that matches the patterns are included in the index. Content that doesn't match the patterns are excluded from the index. If any content matches both an inclusion and exclusion pattern, the exclusion pattern takes precedence, and the content isn't included in the index. |
|
No |
|
Specify true to index ServiceNow knowledge articles, service
catalogs, incidents, and attachments and their ACLs. |
|
No |
|
The type of data source. We recommend that you use SERVICENOWV2 as your data source
type. |
Valid values are |
Yes |
|
NoteAmazon Q Business crawls identity information from your data source by default to ensure responses are generated only from documents end users have access to. For more information, see Identity crawler. |
|
No |
|
Specify whether Amazon Q should update your index by syncing all documents or only new, modified, and deleted documents. |
You can choose between the following options:
|
Yes |
|
The Amazon Resource Name (ARN) of an AWS Secrets Manager secret that contains the key-value pairs required to connect to your ServiceNow. |
The secret must contain a JSON structure with the following keys:
If you use OAuth2 authentication, your secret must contain a JSON structure with the following keys:
|
Yes |
|
The version of the template that's currently supported. |
|
No |
ServiceNow JSON schema for using the configuration property with AWS CloudFormation
The following is the ServiceNow JSON schema and examples for the configuration property for AWS CloudFormation.
Topics
ServiceNow JSON schema for using the configuration property with AWS CloudFormation
The following is the ServiceNow JSON schema for the configuration property for AWS CloudFormation
{ "type": "object", "properties": { "type": { "type": "string", "enum": ["SERVICENOWV2", "SERVICENOW"] }, "syncMode": { "type": "string", "enum": ["FORCED_FULL_CRAWL", "FULL_CRAWL"] }, "secretArn": { "type": "string", "minLength": 20, "maxLength": 2048 }, "enableIdentityCrawler": { "anyOf": [ { "type": "boolean" }, { "type": "string", "enum": ["true", "false"] } ] }, "connectionConfiguration": { "type": "object", "properties": { "repositoryEndpointMetadata": { "type": "object", "properties": { "hostUrl": { "type": "string", "pattern": "^(?!(^(https?|ftp|file):\\/\\/))[a-z0-9-]+(.service-now.com|.servicenowservices.com)$", "minLength": 1, "maxLength": 2048 }, "authType": { "type": "string", "enum": ["basicAuth", "OAuth2"] }, "servicenowInstanceVersion": { "type": "string", "enum": ["Tokyo", "Sandiego", "Rome", "Vancouver", "Others"] } }, "required": ["hostUrl", "authType", "servicenowInstanceVersion"] } }, "required": ["repositoryEndpointMetadata"] }, "repositoryConfigurations": { "type": "object", "properties": { "knowledgeArticle": { "type": "object", "properties": { "fieldMappings": { "type": "array", "items": [ { "type": "object", "properties": { "indexFieldName": { "type": "string" }, "indexFieldType": { "type": "string", "enum": ["STRING", "DATE", "STRING_LIST"] }, "dataSourceFieldName": { "type": "string" }, "dateFieldFormat": { "type": "string", "pattern": "yyyy-MM-dd'T'HH:mm:ss'Z'" } }, "required": [ "indexFieldName", "indexFieldType", "dataSourceFieldName" ] } ] } }, "required": ["fieldMappings"] }, "attachment": { "type": "object", "properties": { "fieldMappings": { "type": "array", "items": [ { "type": "object", "properties": { "indexFieldName": { "type": "string" }, "indexFieldType": { "type": "string", "enum": ["STRING", "LONG", "DATE", "STRING_LIST"] }, "dataSourceFieldName": { "type": "string" }, "dateFieldFormat": { "type": "string", "pattern": "yyyy-MM-dd'T'HH:mm:ss'Z'" } }, "required": [ "indexFieldName", "indexFieldType", "dataSourceFieldName" ] } ] } }, "required": ["fieldMappings"] }, "serviceCatalog": { "type": "object", "properties": { "fieldMappings": { "type": "array", "items": [ { "type": "object", "properties": { "indexFieldName": { "type": "string" }, "indexFieldType": { "type": "string", "enum": ["STRING", "DATE", "STRING_LIST"] }, "dataSourceFieldName": { "type": "string" }, "dateFieldFormat": { "type": "string", "pattern": "yyyy-MM-dd'T'HH:mm:ss'Z'" } }, "required": [ "indexFieldName", "indexFieldType", "dataSourceFieldName" ] } ] } }, "required": ["fieldMappings"] }, "incident": { "type": "object", "properties": { "fieldMappings": { "type": "array", "items": [ { "type": "object", "properties": { "indexFieldName": { "type": "string" }, "indexFieldType": { "type": "string", "enum": ["STRING", "DATE", "STRING_LIST"] }, "dataSourceFieldName": { "type": "string" }, "dateFieldFormat": { "type": "string", "pattern": "yyyy-MM-dd'T'HH:mm:ss'Z'" } }, "required": [ "indexFieldName", "indexFieldType", "dataSourceFieldName" ] } ] } }, "required": ["fieldMappings"] } } }, "additionalProperties": { "type": "object", "properties": { "maxFileSizeInMegaBytes": { "type": "string" }, "isCrawlKnowledgeArticle": { "anyOf": [ { "type": "boolean" }, { "type": "string", "enum": ["true", "false"] } ] }, "isCrawlKnowledgeArticleAttachment": { "anyOf": [ { "type": "boolean" }, { "type": "string", "enum": ["true", "false"] } ] }, "includePublicArticlesOnly": { "anyOf": [ { "type": "boolean" }, { "type": "string", "enum": ["true", "false"] } ] }, "knowledgeArticleFilter": { "type": "string" }, "incidentQueryFilter": { "type": "string" }, "serviceCatalogQueryFilter": { "type": "string" }, "isCrawlServiceCatalog": { "anyOf": [ { "type": "boolean" }, { "type": "string", "enum": ["true", "false"] } ] }, "isCrawlServiceCatalogAttachment": { "anyOf": [ { "type": "boolean" }, { "type": "string", "enum": ["true", "false"] } ] }, "isCrawlActiveServiceCatalog": { "anyOf": [ { "type": "boolean" }, { "type": "string", "enum": ["true", "false"] } ] }, "isCrawlInactiveServiceCatalog": { "anyOf": [ { "type": "boolean" }, { "type": "string", "enum": ["true", "false"] } ] }, "isCrawlIncident": { "anyOf": [ { "type": "boolean" }, { "type": "string", "enum": ["true", "false"] } ] }, "isCrawlIncidentAttachment": { "anyOf": [ { "type": "boolean" }, { "type": "string", "enum": ["true", "false"] } ] }, "isCrawlActiveIncident": { "anyOf": [ { "type": "boolean" }, { "type": "string", "enum": ["true", "false"] } ] }, "isCrawlInactiveIncident": { "anyOf": [ { "type": "boolean" }, { "type": "string", "enum": ["true", "false"] } ] }, "applyACLForKnowledgeArticle": { "anyOf": [ { "type": "boolean" }, { "type": "string", "enum": ["true", "false"] } ] }, "applyACLForServiceCatalog": { "anyOf": [ { "type": "boolean" }, { "type": "string", "enum": ["true", "false"] } ] }, "applyACLForIncident": { "anyOf": [ { "type": "boolean" }, { "type": "string", "enum": ["true", "false"] } ] }, "incidentStateType": { "type": "array", "items": { "type": "string", "enum": ["Open", "Open - Unassigned", "Resolved", "All"] } }, "knowledgeArticleTitleRegExp": { "type": "string" }, "serviceCatalogTitleRegExp": { "type": "string" }, "incidentTitleRegExp": { "type": "string" }, "inclusionFileTypePatterns": { "type": "array", "items": { "type": "string" } }, "exclusionFileTypePatterns": { "type": "array", "items": { "type": "string" } }, "inclusionFileNamePatterns": { "type": "array", "items": { "type": "string" } }, "exclusionFileNamePatterns": { "type": "array", "items": { "type": "string" } }, "enableDeletionProtection": { "anyOf": [ { "type": "boolean" }, { "type": "string", "enum": ["true", "false"] } ], "default": false }, "deletionProtectionThreshold": { "type": "string", "default": "15" } }, "required": [] }, "version": { "type": "string", "anyOf": [ { "pattern": "1.0.0" } ] }, "required": [ "type", "syncMode", "secretArn", "connectionConfiguration", "repositoryConfigurations", "additionalProperties" ] } }
ServiceNow JSON schema example for using the configuration property with AWS CloudFormation
The following is the ServiceNow JSON schema example for the configuration property for AWS CloudFormation
{ "AWSTemplateFormatVersion": "2010-09-09", "Description": "CloudFormation SERVICENOW Data Source Template", "Resources": { "DataSourceServiceNow": { "Type": "AWS::QBusiness::DataSource", "Properties": { "ApplicationId": "app12345-1234-1234-1234-123456789012", "IndexId": "indx1234-1234-1234-1234-123456789012", "DisplayName": "MyServiceNowDataSource", "RoleArn": "arn:aws:iam::123456789012:role/qbusiness-data-source-role", "Configuration": { "type": "SERVICENOWV2", "syncMode": "FULL_CRAWL", "secretArn": "arn:aws:secretsmanager:us-west-2:123456789012:secret:my-servicenow-secret", "enableIdentityCrawler": "true", "connectionConfiguration": { "repositoryEndpointMetadata": { "hostUrl": "mycompany.service-now.com", "authType": "basicAuth", "servicenowInstanceVersion": "Tokyo" } }, "repositoryConfigurations": { "knowledgeArticle": { "fieldMappings": [ { "indexFieldName": "article_id", "indexFieldType": "STRING", "dataSourceFieldName": "id", "dateFieldFormat": "yyyy-MM-dd'T'HH:mm:ss'Z'" } ] }, "attachment": { "fieldMappings": [ { "indexFieldName": "attachment_id", "indexFieldType": "STRING", "dataSourceFieldName": "id", "dateFieldFormat": "yyyy-MM-dd'T'HH:mm:ss'Z'" } ] }, "serviceCatalog": { "fieldMappings": [ { "indexFieldName": "catalog_item_id", "indexFieldType": "STRING", "dataSourceFieldName": "id", "dateFieldFormat": "yyyy-MM-dd'T'HH:mm:ss'Z'" } ] }, "incident": { "fieldMappings": [ { "indexFieldName": "incident_id", "indexFieldType": "STRING", "dataSourceFieldName": "id", "dateFieldFormat": "yyyy-MM-dd'T'HH:mm:ss'Z'" } ] } }, "additionalProperties": { "maxFileSizeInMegaBytes": "50", "isCrawlKnowledgeArticle": "true", "isCrawlKnowledgeArticleAttachment": "true", "includePublicArticlesOnly": "false", "knowledgeArticleFilter": "filter_condition", "incidentQueryFilter": "incident_condition", "serviceCatalogQueryFilter": "service_catalog_condition", "isCrawlServiceCatalog": "true", "isCrawlServiceCatalogAttachment": "true", "isCrawlActiveServiceCatalog": "true", "isCrawlInactiveServiceCatalog": "false", "isCrawlIncident": "true", "isCrawlIncidentAttachment": "false", "isCrawlActiveIncident": "true", "isCrawlInactiveIncident": "false", "applyACLForKnowledgeArticle": "true", "applyACLForServiceCatalog": "true", "applyACLForIncident": "true", "incidentStateType": ["Open", "Resolved"], "knowledgeArticleTitleRegExp": ".*", "serviceCatalogTitleRegExp": ".*", "incidentTitleRegExp": ".*", "inclusionFileTypePatterns": ["*.pdf", "*.docx"], "exclusionFileTypePatterns": ["*.tmp"], "inclusionFileNamePatterns": ["important-*"], "exclusionFileNamePatterns": ["temporary-*"], "enableDeletionProtection": "false", "deletionProtectionThreshold": "15" } } } } } }
ServiceNow YAML schema for using the configuration property with AWS CloudFormation
The following is the ServiceNow YAML schema and examples for the configuration property for AWS CloudFormation:
Topics
ServiceNow YAML schema for using the configuration property with AWS CloudFormation
The following is the ServiceNow YAML schema for the configuration property for AWS CloudFormation.
type: object properties: type: type: string enum: - SERVICENOWV2 - SERVICENOW syncMode: type: string enum: - FORCED_FULL_CRAWL - FULL_CRAWL secretArn: type: string minLength: 20 maxLength: 2048 enableIdentityCrawler: anyOf: - type: boolean - type: string enum: - "true" - "false" connectionConfiguration: type: object properties: repositoryEndpointMetadata: type: object properties: hostUrl: type: string pattern: "^(?!(^(https?|ftp|file):\\/\\/))[a-z0-9-]+(.service-now.com|.servicenowservices.com)$" minLength: 1 maxLength: 2048 authType: type: string enum: - basicAuth - OAuth2 servicenowInstanceVersion: type: string enum: - Tokyo - Sandiego - Rome - Vancouver - Others required: - hostUrl - authType - servicenowInstanceVersion required: - repositoryEndpointMetadata repositoryConfigurations: type: object properties: knowledgeArticle: type: object properties: fieldMappings: type: array items: type: object properties: indexFieldName: type: string indexFieldType: type: string enum: - STRING - DATE - STRING_LIST dataSourceFieldName: type: string dateFieldFormat: type: string pattern: "yyyy-MM-dd'T'HH:mm:ss'Z'" required: - indexFieldName - indexFieldType - dataSourceFieldName required: - fieldMappings attachment: type: object properties: fieldMappings: type: array items: type: object properties: indexFieldName: type: string indexFieldType: type: string enum: - STRING - LONG - DATE - STRING_LIST dataSourceFieldName: type: string dateFieldFormat: type: string pattern: "yyyy-MM-dd'T'HH:mm:ss'Z'" required: - indexFieldName - indexFieldType - dataSourceFieldName required: - fieldMappings serviceCatalog: type: object properties: fieldMappings: type: array items: type: object properties: indexFieldName: type: string indexFieldType: type: string enum: - STRING - DATE - STRING_LIST dataSourceFieldName: type: string dateFieldFormat: type: string pattern: "yyyy-MM-dd'T'HH:mm:ss'Z'" required: - indexFieldName - indexFieldType - dataSourceFieldName required: - fieldMappings incident: type: object properties: fieldMappings: type: array items: type: object properties: indexFieldName: type: string indexFieldType: type: string enum: - STRING - DATE - STRING_LIST dataSourceFieldName: type: string dateFieldFormat: type: string pattern: "yyyy-MM-dd'T'HH:mm:ss'Z'" required: - indexFieldName - indexFieldType - dataSourceFieldName required: - fieldMappings additionalProperties: type: object properties: maxFileSizeInMegaBytes: type: string isCrawlKnowledgeArticle: anyOf: - type: boolean - type: string enum: - "true" - "false" isCrawlKnowledgeArticleAttachment: anyOf: - type: boolean - type: string enum: - "true" - "false" includePublicArticlesOnly: anyOf: - type: boolean - type: string enum: - "true" - "false" knowledgeArticleFilter: type: string incidentQueryFilter: type: string serviceCatalogQueryFilter: type: string isCrawlServiceCatalog: anyOf: - type: boolean - type: string enum: - "true" - "false" isCrawlServiceCatalogAttachment: anyOf: - type: boolean - type: string enum: - "true" - "false" isCrawlActiveServiceCatalog: anyOf: - type: boolean - type: string enum: - "true" - "false" isCrawlInactiveServiceCatalog: anyOf: - type: boolean - type: string enum: - "true" - "false" isCrawlIncident: anyOf: - type: boolean - type: string enum: - "true" - "false" isCrawlIncidentAttachment: anyOf: - type: boolean - type: string enum: - "true" - "false" isCrawlActiveIncident: anyOf: - type: boolean - type: string enum: - "true" - "false" isCrawlInactiveIncident: anyOf: - type: boolean - type: string enum: - "true" - "false" applyACLForKnowledgeArticle: anyOf: - type: boolean - type: string enum: - "true" - "false" applyACLForServiceCatalog: anyOf: - type: boolean - type: string enum: - "true" - "false" applyACLForIncident: anyOf: - type: boolean - type: string enum: - "true" - "false" incidentStateType: type: array items: type: string enum: - Open - Open - Unassigned - Resolved - All knowledgeArticleTitleRegExp: type: string serviceCatalogTitleRegExp: type: string incidentTitleRegExp: type: string inclusionFileTypePatterns: type: array items: type: string exclusionFileTypePatterns: type: array items: type: string inclusionFileNamePatterns: type: array items: type: string exclusionFileNamePatterns: type: array items: type: string enableDeletionProtection: anyOf: - type: boolean - type: string enum: - "true" - "false" default: false deletionProtectionThreshold: type: string default: "15" required: [] version: type: string anyOf: - pattern: "1.0.0" required: - type - syncMode - secretArn - connectionConfiguration - repositoryConfigurations - additionalProperties
ServiceNow YAML schema example for using the configuration property with AWS CloudFormation
The following is the ServiceNow YAML example for the Configuration property for AWS CloudFormation:
AWSTemplateFormatVersion: "2010-09-09" Description: CloudFormation SERVICENOW Data Source Template Resources: DataSourceServiceNow: Type: AWS::QBusiness::DataSource Properties: ApplicationId: app12345-1234-1234-1234-123456789012 IndexId: indx1234-1234-1234-1234-123456789012 DisplayName: MyServiceNowDataSource RoleArn: arn:aws:iam::123456789012:role/qbusiness-data-source-role Configuration: type: SERVICENOWV2 syncMode: FULL_CRAWL secretArn: arn:aws:secretsmanager:us-west-2:123456789012:secret:my-servicenow-secret enableIdentityCrawler: "true" connectionConfiguration: repositoryEndpointMetadata: hostUrl: mycompany.service-now.com authType: basicAuth servicenowInstanceVersion: Tokyo repositoryConfigurations: knowledgeArticle: fieldMappings: - indexFieldName: article_id indexFieldType: STRING dataSourceFieldName: id dateFieldFormat: yyyy-MM-dd'T'HH:mm:ss'Z' attachment: fieldMappings: - indexFieldName: attachment_id indexFieldType: STRING dataSourceFieldName: id dateFieldFormat: yyyy-MM-dd'T'HH:mm:ss'Z' serviceCatalog: fieldMappings: - indexFieldName: catalog_item_id indexFieldType: STRING dataSourceFieldName: id dateFieldFormat: yyyy-MM-dd'T'HH:mm:ss'Z' incident: fieldMappings: - indexFieldName: incident_id indexFieldType: STRING dataSourceFieldName: id dateFieldFormat: yyyy-MM-dd'T'HH:mm:ss'Z' additionalProperties: maxFileSizeInMegaBytes: "50" isCrawlKnowledgeArticle: "true" isCrawlKnowledgeArticleAttachment: "true" includePublicArticlesOnly: "false" knowledgeArticleFilter: filter_condition incidentQueryFilter: incident_condition serviceCatalogQueryFilter: service_catalog_condition isCrawlServiceCatalog: "true" isCrawlServiceCatalogAttachment: "true" isCrawlActiveServiceCatalog: "true" isCrawlInactiveServiceCatalog: "false" isCrawlIncident: "true" isCrawlIncidentAttachment: "false" isCrawlActiveIncident: "true" isCrawlInactiveIncident: "false" applyACLForKnowledgeArticle: "true" applyACLForServiceCatalog: "true" applyACLForIncident: "true" incidentStateType: - Open - Resolved knowledgeArticleTitleRegExp: ".*" serviceCatalogTitleRegExp: ".*" incidentTitleRegExp: ".*" inclusionFileTypePatterns: - "*.pdf" - "*.docx" exclusionFileTypePatterns: - "*.tmp" inclusionFileNamePatterns: - important-* exclusionFileNamePatterns: - temporary-* enableDeletionProtection: "false" deletionProtectionThreshold: "15"