Skip to content

create_data_source

Operation

create_data_source

create_data_source(request: CreateDataSourceInput | CreateDataSourceInputDict | None = None, /, *, plugins: list[Plugin] | None = None, **kwargs: Unpack[CreateDataSourceInputDict]) -> CreateDataSourceOutput

Creates a data source connector for an Amazon Q Business application.

CreateDataSource is a synchronous operation. The operation returns 200 if the data source was successfully created. Otherwise, an exception is raised.

Parameters:

Name Type Description Default
request CreateDataSourceInput | CreateDataSourceInputDict | None

The input as a model or dictionary. Pass this or keyword arguments, not both.

None
plugins list[Plugin] | None

A list of callables that modify the configuration dynamically. Changes made by these plugins only apply for the duration of the operation execution and will not affect any other operation invocations.

None
**kwargs Unpack[CreateDataSourceInputDict]

The input fields as keyword arguments.

{}

Returns:

Type Description
CreateDataSourceOutput

An instance of CreateDataSourceOutput.

create_data_source async

create_data_source(request: CreateDataSourceInput | CreateDataSourceInputDict | None = None, /, *, plugins: list[Plugin] | None = None, **kwargs: Unpack[CreateDataSourceInputDict]) -> CreateDataSourceOutput

Creates a data source connector for an Amazon Q Business application.

CreateDataSource is a synchronous operation. The operation returns 200 if the data source was successfully created. Otherwise, an exception is raised.

Parameters:

Name Type Description Default
request CreateDataSourceInput | CreateDataSourceInputDict | None

The input as a model or dictionary. Pass this or keyword arguments, not both.

None
plugins list[Plugin] | None

A list of callables that modify the configuration dynamically. Changes made by these plugins only apply for the duration of the operation execution and will not affect any other operation invocations.

None
**kwargs Unpack[CreateDataSourceInputDict]

The input fields as keyword arguments.

{}

Returns:

Type Description
CreateDataSourceOutput

An instance of CreateDataSourceOutput.

Input

Pass the input as keyword arguments, a positional dictionary, or a positional model object. Pass plugins separately as a keyword argument.

CreateDataSourceInputDict

Bases: TypedDict

Dictionary form of CreateDataSourceInput.

Attributes

application_id instance-attribute
application_id: Required[str]

The identifier of the Amazon Q Business application the data source will be attached to.

client_token instance-attribute
client_token: str | None

A token you provide to identify a request to create a data source connector. Multiple calls to the CreateDataSource API with the same client token will create only one data source connector.

This field is autopopulated if not provided.

configuration instance-attribute
configuration: Required[Document]

Configuration information to connect your data source repository to Amazon Q Business. Use this parameter to provide a JSON schema with configuration information specific to your data source connector.

Each data source has a JSON schema provided by Amazon Q Business that you must use. For example, the Amazon S3 and Web Crawler connectors require the following JSON schemas:

You can find configuration templates for your specific data source using the following steps:

  1. Navigate to the Supported connectors page in the Amazon Q Business User Guide, and select the data source of your choice.

  2. Then, from your specific data source connector page, select Using the API. You will find the JSON schema for your data source, including parameter descriptions, in this section.

description instance-attribute
description: str | None

A description for the data source connector.

display_name instance-attribute
display_name: Required[str]

A name for the data source connector.

document_enrichment_configuration instance-attribute
document_enrichment_configuration: DocumentEnrichmentConfiguration | DocumentEnrichmentConfigurationDict | None

Provides the configuration information for altering document metadata and content during the document ingestion process.

For more information, see Custom document enrichment.

index_id instance-attribute
index_id: Required[str]

The identifier of the index that you want to use with the data source connector.

media_extraction_configuration instance-attribute
media_extraction_configuration: MediaExtractionConfiguration | MediaExtractionConfigurationDict | None

The configuration for extracting information from media in documents during ingestion.

role_arn instance-attribute
role_arn: str | None

The Amazon Resource Name (ARN) of an IAM role with permission to access the data source and required resources. This field is required for all connector types except custom connectors, where it is optional.

sync_schedule instance-attribute
sync_schedule: str | None

Sets the frequency for Amazon Q Business to check the documents in your data source repository and update your index. If you don't set a schedule, Amazon Q Business won't periodically update the index.

Specify a cron- format schedule string or an empty string to indicate that the index is updated on demand. You can't specify the Schedule parameter when the Type parameter is set to CUSTOM. If you do, you receive a ValidationException exception.

tags instance-attribute
tags: Sequence[Tag | TagDict] | None

A list of key-value pairs that identify or categorize the data source connector. You can also use tags to help control access to the data source connector. Tag keys and values can consist of Unicode letters, digits, white space, and any of the following symbols: _ . : / = + - @.

vpc_configuration instance-attribute

Configuration information for an Amazon VPC (Virtual Private Cloud) to connect to your data source. For more information, see Using Amazon VPC with Amazon Q Business connectors.

CreateDataSourceInput dataclass

Bases: _SerdeShape

Dataclass for CreateDataSourceInput structure.

Attributes

application_id class-attribute instance-attribute
application_id: str | None = ...

The identifier of the Amazon Q Business application the data source will be attached to.

client_token class-attribute instance-attribute
client_token: str | None = ...

A token you provide to identify a request to create a data source connector. Multiple calls to the CreateDataSource API with the same client token will create only one data source connector.

This field is autopopulated if not provided.

configuration class-attribute instance-attribute
configuration: Document | None = ...

Configuration information to connect your data source repository to Amazon Q Business. Use this parameter to provide a JSON schema with configuration information specific to your data source connector.

Each data source has a JSON schema provided by Amazon Q Business that you must use. For example, the Amazon S3 and Web Crawler connectors require the following JSON schemas:

You can find configuration templates for your specific data source using the following steps:

  1. Navigate to the Supported connectors page in the Amazon Q Business User Guide, and select the data source of your choice.

  2. Then, from your specific data source connector page, select Using the API. You will find the JSON schema for your data source, including parameter descriptions, in this section.

description class-attribute instance-attribute
description: str | None = ...

A description for the data source connector.

display_name class-attribute instance-attribute
display_name: str | None = ...

A name for the data source connector.

document_enrichment_configuration class-attribute instance-attribute
document_enrichment_configuration: DocumentEnrichmentConfiguration | None = ...

Provides the configuration information for altering document metadata and content during the document ingestion process.

For more information, see Custom document enrichment.

index_id class-attribute instance-attribute
index_id: str | None = ...

The identifier of the index that you want to use with the data source connector.

media_extraction_configuration class-attribute instance-attribute
media_extraction_configuration: MediaExtractionConfiguration | None = ...

The configuration for extracting information from media in documents during ingestion.

role_arn class-attribute instance-attribute
role_arn: str | None = ...

The Amazon Resource Name (ARN) of an IAM role with permission to access the data source and required resources. This field is required for all connector types except custom connectors, where it is optional.

sync_schedule class-attribute instance-attribute
sync_schedule: str | None = ...

Sets the frequency for Amazon Q Business to check the documents in your data source repository and update your index. If you don't set a schedule, Amazon Q Business won't periodically update the index.

Specify a cron- format schedule string or an empty string to indicate that the index is updated on demand. You can't specify the Schedule parameter when the Type parameter is set to CUSTOM. If you do, you receive a ValidationException exception.

tags class-attribute instance-attribute
tags: list[Tag] | None = ...

A list of key-value pairs that identify or categorize the data source connector. You can also use tags to help control access to the data source connector. Tag keys and values can consist of Unicode letters, digits, white space, and any of the following symbols: _ . : / = + - @.

vpc_configuration class-attribute instance-attribute
vpc_configuration: DataSourceVpcConfiguration | None = ...

Configuration information for an Amazon VPC (Virtual Private Cloud) to connect to your data source. For more information, see Using Amazon VPC with Amazon Q Business connectors.

Output

CreateDataSourceOutput dataclass

Bases: _SerdeShape

Dataclass for CreateDataSourceOutput structure.

Attributes

data_source_arn class-attribute instance-attribute
data_source_arn: str | None = ...

The Amazon Resource Name (ARN) of a data source in an Amazon Q Business application.

data_source_id class-attribute instance-attribute
data_source_id: str | None = ...

The identifier of the data source connector.

response_metadata class-attribute instance-attribute
response_metadata: ResponseMetadata = ...

Metadata about the response that produced this output. Use this to recover the request identifiers a service's support team needs in order to investigate a call. Members of the metadata are individually optional.