ab_tests
Creates, updates, deletes, gets or lists an ab_tests resource.
Overview
| Name | ab_tests |
| Type | Resource |
| Id | aws.bedrock_agentcore.ab_tests |
Fields
The following fields are returned by SELECT queries:
- get_ab_test
- list_ab_tests
| Name | Datatype | Description |
|---|---|---|
name | string | The name of the A/B test. (pattern: <code>[a-zA-Z][a-zA-Z0-9_]{0,47}</code>) |
ab_test_arn | string | The 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_id | string | The 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_at | string (date-time) | The timestamp when the A/B test was created. |
current_run_id | string | The identifier of the current run of the A/B test. |
description | string | The description of the A/B test. |
error_details | array | The error details if the A/B test encountered failures. |
evaluation_config | object | The evaluation configuration for an A/B test, specifying which online evaluation configurations to use for measuring variant performance. |
execution_status | string | The execution status indicating whether the A/B test is currently running. (PAUSED, RUNNING, STOPPED, NOT_STARTED) |
gateway_arn | string | The 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_filter | object | A filter to restrict which gateway target paths are included in the A/B test. |
max_duration_expires_at | string (date-time) | The timestamp when the A/B test will automatically expire. |
results | object | The statistical results of the A/B test, including per-evaluator metrics and significance analysis. |
role_arn | string | The IAM role ARN used by the A/B test. (pattern: <code>arn:aws(-[^:]+)?:iam::([0-9]{12})?:role/.+</code>) |
started_at | string (date-time) | The timestamp when the A/B test was started. |
status | string | The current status of the A/B test. (CREATING, ACTIVE, CREATE_FAILED, UPDATING, UPDATE_FAILED, DELETING, DELETE_FAILED, FAILED) |
stopped_at | string (date-time) | The timestamp when the A/B test was stopped. |
updated_at | string (date-time) | The timestamp when the A/B test was last updated. |
variants | array | The list of variants in the A/B test. |
| Name | Datatype | Description |
|---|---|---|
name | string | The name of the A/B test. (pattern: <code>[a-zA-Z][a-zA-Z0-9_]{0,47}</code>) |
ab_test_arn | string | The 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_id | string | The 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_at | string (date-time) | The timestamp when the A/B test was created. |
description | string | The description of the A/B test. |
execution_status | string | The execution status of the A/B test. (PAUSED, RUNNING, STOPPED, NOT_STARTED) |
gateway_arn | string | The 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>) |
status | string | The current status of the A/B test. (CREATING, ACTIVE, CREATE_FAILED, UPDATING, UPDATE_FAILED, DELETING, DELETE_FAILED, FAILED) |
updated_at | string (date-time) | The timestamp when the A/B test was last updated. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_ab_test | select | ab_test_id, region | Retrieves detailed information about an A/B test, including its configuration, status, and statistical results. | |
list_ab_tests | select | region | maxResults, nextToken | Lists all A/B tests in the account. |
create_ab_test | insert | region, name, gatewayArn, variants, evaluationConfig, roleArn | 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. | |
update_ab_test | update | ab_test_id, region | Updates an A/B test's configuration, including variants, traffic allocation, evaluation settings, or execution status. | |
delete_ab_test | delete | ab_test_id, region | Deletes 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.
| Name | Datatype | Description |
|---|---|---|
ab_test_id | string | The unique identifier of the A/B test to delete. |
region | string | AWS region (default: us-east-1) |
maxResults | integer | The 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. |
nextToken | string | If 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
- get_ab_test
- list_ab_tests
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
;
Lists all A/B tests in the account.
SELECT
name,
ab_test_arn,
ab_test_id,
created_at,
description,
execution_status,
gateway_arn,
status,
updated_at
FROM aws.bedrock_agentcore.ab_tests
WHERE region = '{{ region }}' -- required
AND maxResults = '{{ maxResults }}'
AND nextToken = '{{ nextToken }}'
;
INSERT examples
- create_ab_test
- Manifest
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
;
# Description fields are for documentation purposes
- name: ab_tests
props:
- name: region
value: "{{ region }}"
description: Required parameter for the ab_tests resource.
- name: name
value: "{{ name }}"
- name: description
value: "{{ description }}"
- name: gatewayArn
value: "{{ gatewayArn }}"
- name: variants
value:
- name: "{{ name }}"
weight: {{ weight }}
variantConfiguration:
configurationBundle:
bundleArn: "{{ bundleArn }}"
bundleVersion: "{{ bundleVersion }}"
target:
name: "{{ name }}"
- name: gatewayFilter
description: |
A filter to restrict which gateway target paths are included in the A/B test.
value:
targetPaths:
- "{{ targetPaths }}"
- name: evaluationConfig
description: |
The evaluation configuration for an A/B test, specifying which online evaluation configurations to use for measuring variant performance.
value:
onlineEvaluationConfigArn: "{{ onlineEvaluationConfigArn }}"
perVariantOnlineEvaluationConfig:
- name: "{{ name }}"
onlineEvaluationConfigArn: "{{ onlineEvaluationConfigArn }}"
- name: roleArn
value: "{{ roleArn }}"
- name: enableOnCreate
value: {{ enableOnCreate }}
- name: clientToken
value: "{{ clientToken }}"
- name: tags
value: "{{ tags }}"
UPDATE examples
- update_ab_test
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
- delete_ab_test
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
;