Skip to main content

data_sources

Creates, updates, deletes or gets a data_source resource or lists data_sources in a region

Overview

Namedata_sources
TypeResource
DescriptionDefinition of AWS::Bedrock::DataSource Resource Type
Idawscc.bedrock.data_sources

Fields

NameDatatypeDescription
data_source_configurationobjectSpecifies a raw data source location to ingest.
data_source_idstringIdentifier for a resource.
descriptionstringDescription of the Resource.
knowledge_base_idstringThe unique identifier of the knowledge base to which to add the data source.
data_source_statusstringThe status of a data source.
namestringThe name of the data source.
server_side_encryption_configurationobjectContains details about the server-side encryption for the data source.
vector_ingestion_configurationobjectDetails about how to chunk the documents in the data source. A chunk refers to an excerpt from a data source that is returned when the knowledge base that it belongs to is queried.
data_deletion_policystringThe deletion policy for the data source.
created_atstringThe time at which the data source was created.
updated_atstringThe time at which the knowledge base was last updated.
failure_reasonsarrayThe details of the failure reasons related to the data source.
regionstringAWS region.

For more information, see AWS::Bedrock::DataSource.

Methods

NameResourceAccessible byRequired Params
create_resourcedata_sourcesINSERTDataSourceConfiguration, Name, KnowledgeBaseId, region
delete_resourcedata_sourcesDELETEIdentifier, region
update_resourcedata_sourcesUPDATEIdentifier, PatchDocument, region
list_resourcesdata_sources_list_onlySELECTregion
get_resourcedata_sourcesSELECTIdentifier, region

SELECT examples

Gets all properties from an individual data_source.

SELECT
region,
data_source_configuration,
data_source_id,
description,
knowledge_base_id,
data_source_status,
name,
server_side_encryption_configuration,
vector_ingestion_configuration,
data_deletion_policy,
created_at,
updated_at,
failure_reasons
FROM awscc.bedrock.data_sources
WHERE
region = '{{ region }}' AND
Identifier = '{{ knowledge_base_id }}|{{ data_source_id }}';

INSERT example

Use the following StackQL query and manifest file to create a new data_source resource, using stack-deploy.

/*+ create */
INSERT INTO awscc.bedrock.data_sources (
DataSourceConfiguration,
KnowledgeBaseId,
Name,
region
)
SELECT
'{{ data_source_configuration }}',
'{{ knowledge_base_id }}',
'{{ name }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

UPDATE example

Use the following StackQL query and manifest file to update a data_source resource, using stack-deploy.

/*+ update */
UPDATE awscc.bedrock.data_sources
SET PatchDocument = string('{{ {
"Description": description,
"Name": name,
"ServerSideEncryptionConfiguration": server_side_encryption_configuration,
"DataDeletionPolicy": data_deletion_policy
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ knowledge_base_id }}|{{ data_source_id }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

DELETE example

/*+ delete */
DELETE FROM awscc.bedrock.data_sources
WHERE
Identifier = '{{ knowledge_base_id }}|{{ data_source_id }}' AND
region = '{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

Additional Parameters

Mutable resources in the Cloud Control provider support additional optional parameters which can be supplied with INSERT, UPDATE, or DELETE operations. These include:

ParameterDescription
ClientToken
A unique identifier to ensure the idempotency of the resource request.This allows the provider to accurately distinguish between retries and new requests.
A client token is valid for 36 hours once used.
After that, a resource request with the same client token is treated as a new request.
If you do not specify a client token, one is generated for inclusion in the request.
RoleArn
The ARN of the IAM role used to perform this resource operation.The role specified must have the permissions required for this operation.
If you do not specify a role, a temporary session is created using your AWS user credentials.
TypeVersionId
For private resource types, the type version to use in this resource operation.If you do not specify a resource version, the default version is used.

Permissions

To operate on the data_sources resource, the following permissions are required:

bedrock:CreateDataSource,
bedrock:GetDataSource,
bedrock:GetKnowledgeBase,
kms:GenerateDataKey