Skip to main content

datasets

Creates, updates, deletes, gets or lists a datasets resource.

Overview

Namedatasets
TypeResource
Idaws.bedrock_agentcore_control.datasets

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
created_atstring (date-time)The timestamp when the dataset was created.
dataset_arnstringThe Amazon Resource Name (ARN) of the dataset. (pattern: <code>arn:aws(-[a-z]+)*:bedrock-agentcore:[a-z0-9-]+:[0-9]{12}:dataset/[a-zA-Z0-9_-]{1,110}</code>)
dataset_idstringThe unique identifier of the dataset. (pattern: <code>[a-zA-Z0-9_-]{1,110}</code>)
dataset_namestringThe name of the dataset. (pattern: <code>[a-zA-Z][a-zA-Z0-9_]{0,47}</code>)
dataset_versionstringDataset version identifier. Accepts "DRAFT" or a non-negative integer string representing a published version number. (pattern: <code>(DRAFT|[0-9]+)</code>)
descriptionstringThe description of the dataset.
download_urlstringPresigned Amazon S3 URL to download the consolidated dataset file for the resolved version. Expires after 5 minutes. Omitted if the file does not yet exist.
download_url_expires_atstring (date-time)Expiry timestamp for the download URL.
draft_statusstringPublish synchronization state. Only authoritative when status is ACTIVE. MODIFIED indicates DRAFT has unpublished changes. UNMODIFIED indicates DRAFT matches the latest published version. (MODIFIED, UNMODIFIED)
example_countinteger (int64)The number of examples in the DRAFT.
failure_reasonstringPopulated when status is CREATE_FAILED, UPDATE_FAILED, or DELETE_FAILED. Describes the reason for the failure.
kms_key_arnstringKMS key ARN used for server-side encryption on service Amazon S3 writes, if configured. (pattern: <code>arn:aws(|-cn|-us-gov):kms:[a-zA-Z0-9-]*:[0-9]{12}:key/[a-zA-Z0-9-]{36}</code>)
schema_typestringVersioned schema type for dataset examples. Each value identifies both the source format and the version of that format's schema. (AGENTCORE_EVALUATION_PREDEFINED_V1, AGENTCORE_EVALUATION_SIMULATED_V1, GENERIC_EVALUATION_PREDEFINED_V1)
statusstringThe current status of the dataset. (CREATING, UPDATING, DELETING, ACTIVE, CREATE_FAILED, UPDATE_FAILED, DELETE_FAILED)
tagsobjectThe tags associated with the dataset.
updated_atstring (date-time)The timestamp when the dataset was last updated.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_datasetselectdataset_id, regiondatasetVersionRetrieves dataset metadata. Use the datasetVersion query parameter to retrieve a specific version's metadata. If absent, defaults to DRAFT. For paginated example content, use ListDatasetExamples.
list_datasetsselectregionnextToken, maxResultsLists all datasets in the caller's account, paginated.
create_datasetinsertregion, datasetName, source, schemaTypeCreates a new dataset resource asynchronously. Returns immediately with status CREATING. Poll GetDataset until status transitions to ACTIVE or CREATE_FAILED.
update_datasetupdatedataset_id, regionUpdates a dataset's metadata. Synchronous operation. Only provided fields are updated; omitted fields remain unchanged. To modify dataset content, use AddDatasetExamples, UpdateDatasetExamples, or DeleteDatasetExamples.
delete_datasetdeletedataset_id, regiondatasetVersionDeletes a dataset version or an entire dataset asynchronously. If datasetVersion is absent, deletes all versions and the dataset record itself. If provided, deletes only that specific version.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
dataset_idstringThe unique identifier of the dataset to delete.
regionstringAWS region (default: us-east-1)
datasetVersionstringOptional version to delete. If absent, deletes the entire dataset. If provided, deletes only that specific version.
maxResultsintegerThe maximum number of datasets to return per page.
nextTokenstringThe token for the next page of results.

SELECT examples

Retrieves dataset metadata. Use the datasetVersion query parameter to retrieve a specific version's metadata. If absent, defaults to DRAFT. For paginated example content, use ListDatasetExamples.

SELECT
created_at,
dataset_arn,
dataset_id,
dataset_name,
dataset_version,
description,
download_url,
download_url_expires_at,
draft_status,
example_count,
failure_reason,
kms_key_arn,
schema_type,
status,
tags,
updated_at
FROM aws.bedrock_agentcore_control.datasets
WHERE dataset_id = '{{ dataset_id }}' -- required
AND region = '{{ region }}' -- required
AND datasetVersion = '{{ datasetVersion }}'
;

INSERT examples

Creates a new dataset resource asynchronously. Returns immediately with status CREATING. Poll GetDataset until status transitions to ACTIVE or CREATE_FAILED.

INSERT INTO aws.bedrock_agentcore_control.datasets (
clientToken,
datasetName,
description,
source,
schemaType,
kmsKeyArn,
tags,
region
)
SELECT
'{{ clientToken }}',
'{{ datasetName }}' /* required */,
'{{ description }}',
'{{ source }}' /* required */,
'{{ schemaType }}' /* required */,
'{{ kmsKeyArn }}',
'{{ tags }}',
'{{ region }}'
RETURNING
created_at,
dataset_arn,
dataset_id,
status
;

UPDATE examples

Updates a dataset's metadata. Synchronous operation. Only provided fields are updated; omitted fields remain unchanged. To modify dataset content, use AddDatasetExamples, UpdateDatasetExamples, or DeleteDatasetExamples.

UPDATE aws.bedrock_agentcore_control.datasets
SET
clientToken = '{{ clientToken }}',
description = '{{ description }}'
WHERE
dataset_id = '{{ dataset_id }}' --required
AND region = '{{ region }}' --required
RETURNING
dataset_arn,
dataset_id,
updated_at;

DELETE examples

Deletes a dataset version or an entire dataset asynchronously. If datasetVersion is absent, deletes all versions and the dataset record itself. If provided, deletes only that specific version.

DELETE FROM aws.bedrock_agentcore_control.datasets
WHERE dataset_id = '{{ dataset_id }}' --required
AND region = '{{ region }}' --required
AND datasetVersion = '{{ datasetVersion }}'
;