Skip to main content

ab_tests

Creates, updates, deletes, gets or lists an ab_tests resource.

Overview

Nameab_tests
TypeResource
Idaws.bedrock_agentcore.ab_tests

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
namestringThe name of the A/B test. (pattern: <code>[a-zA-Z][a-zA-Z0-9_]{0,47}</code>)
ab_test_arnstringThe Amazon Resource Name (ARN) of the A/B test. (pattern: <code>arn:aws[a-zA-Z-]*:bedrock-agentcore:[a-z0-9-]+:[0-9]{12}:ab-test/[a-zA-Z][a-zA-Z0-9-_]{0,99}-[a-zA-Z0-9]{10}</code>)
ab_test_idstringThe unique identifier of the A/B test. (pattern: <code>[a-zA-Z][a-zA-Z0-9-_]{0,99}-[a-zA-Z0-9]{10}</code>)
created_atstring (date-time)The timestamp when the A/B test was created.
current_run_idstringThe identifier of the current run of the A/B test.
descriptionstringThe description of the A/B test.
error_detailsarrayThe error details if the A/B test encountered failures.
evaluation_configobjectThe evaluation configuration for an A/B test, specifying which online evaluation configurations to use for measuring variant performance.
execution_statusstringThe execution status indicating whether the A/B test is currently running. (PAUSED, RUNNING, STOPPED, NOT_STARTED)
gateway_arnstringThe Amazon Resource Name (ARN) of the gateway used for traffic splitting. (pattern: <code>arn:aws(|-cn|-us-gov):bedrock-agentcore:[a-z0-9-]{1,20}:[0-9]{12}:gateway/([0-9a-z][-]?){1,48}-[a-z0-9]{10}</code>)
gateway_filterobjectA filter to restrict which gateway target paths are included in the A/B test.
max_duration_expires_atstring (date-time)The timestamp when the A/B test will automatically expire.
resultsobjectThe statistical results of the A/B test, including per-evaluator metrics and significance analysis.
role_arnstringThe IAM role ARN used by the A/B test. (pattern: <code>arn:aws(-[^:]+)?:iam::([0-9]{12})?:role/.+</code>)
started_atstring (date-time)The timestamp when the A/B test was started.
statusstringThe current status of the A/B test. (CREATING, ACTIVE, CREATE_FAILED, UPDATING, UPDATE_FAILED, DELETING, DELETE_FAILED, FAILED)
stopped_atstring (date-time)The timestamp when the A/B test was stopped.
updated_atstring (date-time)The timestamp when the A/B test was last updated.
variantsarrayThe list of variants in the A/B test.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_ab_testselectab_test_id, regionRetrieves detailed information about an A/B test, including its configuration, status, and statistical results.
list_ab_testsselectregionmaxResults, nextTokenLists all A/B tests in the account.
create_ab_testinsertregion, name, gatewayArn, variants, evaluationConfig, roleArnCreates an A/B test for comparing agent configurations. A/B tests split traffic between a control variant and a treatment variant through a gateway, then evaluate performance using online evaluation configurations to determine which variant performs better.
update_ab_testupdateab_test_id, regionUpdates an A/B test's configuration, including variants, traffic allocation, evaluation settings, or execution status.
delete_ab_testdeleteab_test_id, regionDeletes an A/B test and its associated gateway rules.

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
ab_test_idstringThe unique identifier of the A/B test to delete.
regionstringAWS region (default: us-east-1)
maxResultsintegerThe maximum number of results to return in the response. If the total number of results is greater than this value, use the token returned in the response in the nextToken field when making another request to return the next batch of results.
nextTokenstringIf the total number of results is greater than the maxResults value provided in the request, enter the token returned in the nextToken field in the response in this field to return the next batch of results.

SELECT examples

Retrieves detailed information about an A/B test, including its configuration, status, and statistical results.

SELECT
name,
ab_test_arn,
ab_test_id,
created_at,
current_run_id,
description,
error_details,
evaluation_config,
execution_status,
gateway_arn,
gateway_filter,
max_duration_expires_at,
results,
role_arn,
started_at,
status,
stopped_at,
updated_at,
variants
FROM aws.bedrock_agentcore.ab_tests
WHERE ab_test_id = '{{ ab_test_id }}' -- required
AND region = '{{ region }}' -- required
;

INSERT examples

Creates an A/B test for comparing agent configurations. A/B tests split traffic between a control variant and a treatment variant through a gateway, then evaluate performance using online evaluation configurations to determine which variant performs better.

INSERT INTO aws.bedrock_agentcore.ab_tests (
name,
description,
gatewayArn,
variants,
gatewayFilter,
evaluationConfig,
roleArn,
enableOnCreate,
clientToken,
tags,
region
)
SELECT
'{{ name }}' /* required */,
'{{ description }}',
'{{ gatewayArn }}' /* required */,
'{{ variants }}' /* required */,
'{{ gatewayFilter }}',
'{{ evaluationConfig }}' /* required */,
'{{ roleArn }}' /* required */,
{{ enableOnCreate }},
'{{ clientToken }}',
'{{ tags }}',
'{{ region }}'
RETURNING
name,
ab_test_arn,
ab_test_id,
created_at,
execution_status,
status
;

UPDATE examples

Updates an A/B test's configuration, including variants, traffic allocation, evaluation settings, or execution status.

UPDATE aws.bedrock_agentcore.ab_tests
SET
clientToken = '{{ clientToken }}',
name = '{{ name }}',
description = '{{ description }}',
variants = '{{ variants }}',
gatewayFilter = '{{ gatewayFilter }}',
evaluationConfig = '{{ evaluationConfig }}',
roleArn = '{{ roleArn }}',
executionStatus = '{{ executionStatus }}'
WHERE
ab_test_id = '{{ ab_test_id }}' --required
AND region = '{{ region }}' --required
RETURNING
ab_test_arn,
ab_test_id,
execution_status,
status,
updated_at;

DELETE examples

Deletes an A/B test and its associated gateway rules.

DELETE FROM aws.bedrock_agentcore.ab_tests
WHERE ab_test_id = '{{ ab_test_id }}' --required
AND region = '{{ region }}' --required
;