Connect a Salesforce data source
After you set up authentication and store your credentials in an AWS Secrets Manager secret, create the Salesforce data source in your knowledge base. This page describes how to create the data source with the AWS Management Console or the API, followed by a reference for the connector parameters you can configure.
Note
Complete authentication setup first. See Set up OAuth 2.0 Client Credentials authentication for Salesforce. To use document-level access control, also complete Set up OAuth 2.0 JWT Bearer authentication for Salesforce document-level access controls. You need the secret ARN.
Create the data source
Connector parameters
The data source configuration uses the following connector parameters. Within
connectorParameters, set both type and
connectorType to SALESFORCE and set version
to 1. For the fields that wrap connectorParameters (such as
deletionProtectionConfiguration and
mediaExtractionConfiguration), see Connect a data source.
The following table describes the connectionConfiguration fields.
| Field | Required | Description |
|---|---|---|
secretArn |
Yes | The ARN of the AWS Secrets Manager secret containing your
clientId, clientSecret, and
instanceUrl. For OAUTH2_WITH_JWT_BEARER,
the secret also contains consumerKey,
privateKey, and instanceType. See Step 5: Create the Secrets Manager secret. |
hostUrl |
Yes | Your Salesforce My Domain URL (for example,
https://).
Accepted formats are *.my.salesforce.com and
*.lightning.force.com. This value must match the
instanceUrl in the secret. |
authType |
Yes | The authentication type: OAUTH2 or
OAUTH2_WITH_JWT_BEARER. The
OAUTH2_WITH_JWT_BEARER type is available only when
aclEnabled is true. See Authentication methods. |
The following table describes the optional aclEnabled field.
| Field | Required | Description |
|---|---|---|
aclEnabled |
No | Set to true to enable document-level access control.
Requires OAUTH2_WITH_JWT_BEARER authentication. You
cannot change this setting after you create the data source. For
details, see Document-level access controls. |
The following table describes the dataEntityConfiguration fields,
which control the entities that the connector crawls. In the console, Knowledge
articles and their attachments are combined into a single Knowledge
articles (includes attachments) option, but the API exposes them as
separate fields.
| Field | Required | Description |
|---|---|---|
crawlKnowledgeArticles |
Yes | Whether to crawl Salesforce Knowledge articles. |
crawlKnowledgeArticleAttachments |
Yes | Whether to crawl attachments on Knowledge articles. |
crawlArchiveKnowledgeArticleItems |
Yes | Whether to crawl archived Knowledge articles. |
crawlDocuments |
Yes | Whether to crawl Salesforce documents. |
The following table describes the optional filterConfiguration
fields, which scope the crawl.
| Field | Required | Description |
|---|---|---|
knowledgeArticleFilter |
No | Scopes Knowledge article crawling. Contains
dataCategoryConfiguration, a list of objects that each
contain categoryGroupName (the data category group),
dataCategoryNames (a list of category names), and
operator (the category depth). See the category depth
values that follow. |
documentFilter |
No | Scopes document crawling. Contains folderIds (a list
of Salesforce folder IDs); the connector syncs documents from those
folders only. |
maxFileSizeInMegaBytes |
No | Maximum size, in megabytes, of any single file the connector
ingests. Provide as a numeric string (for example,
"500"). |
The operator field in dataCategoryConfiguration sets the
category depth – which articles to sync relative to the specified
category:
-
AT– Only articles in the exact category specified. -
ABOVE– Articles in the specified category and all its parent categories. -
BELOW– Articles in the specified category and all its subcategories. -
ABOVE_OR_BELOW– Articles in the specified category, its parents, and its subcategories.
Next steps
After you create the data source, sync it to ingest content into your knowledge base. For details, see Sync a data source. To filter query results by user permissions, see Document-level access controls.