Skip to main content

experiment_definitions

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

Overview

Nameexperiment_definitions
TypeResource
Idaws.appconfig.experiment_definitions

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
application_idstringThe application ID. (pattern: <code>[a-z0-9]{4,7}</code>)
audience_descriptionstringA description of the intended audience for the experiment.
audience_rulestringThe rule that defines which users are eligible to be assigned to treatments.
configuration_profile_idstringThe configuration profile ID associated with the experiment. (pattern: <code>[a-z0-9]{4,7}</code>)
controlobjectDescribes a treatment in an experiment, including its traffic allocation weight and feature flag value.
created_atstring (date-time)The date and time the experiment definition was created, in ISO 8601 format.
environment_idstringThe environment ID where the experiment runs. (pattern: <code>[a-z0-9]{4,7}</code>)
flag_keystringThe key of the feature flag used by the experiment. (pattern: <code>^[a-z][a-zA-Z0-9_-]{1,64}</code>)
hypothesisstringThe hypothesis that the experiment is designed to validate.
idstringThe experiment definition ID. (pattern: <code>[a-z0-9]{4,7}</code>)
kms_key_identifierstringThe Amazon Resource Name (ARN) of the KMS key used to encrypt experiment data.
launch_criteriastringThe conditions under which the winning treatment should be launched.
namestringThe name of the experiment definition.
statusstringThe current status of the experiment definition. Valid values: ACTIVE, IDLE, ARCHIVED. (ACTIVE, IDLE, ARCHIVED)
treatmentsarrayThe list of treatments defined for the experiment.
updated_atstring (date-time)The date and time the experiment definition was last updated, in ISO 8601 format.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_experiment_definitionselectapplication_identifier, experiment_definition_identifier, regionRetrieves information about an experiment definition.
list_experiment_definitionsselectregionapplication_identifier, configuration_profile_identifier, environment_identifier, status, max_results, next_tokenLists the experiment definitions for an account. You can filter results by application, configuration profile, environment, or status.
create_experiment_definitioninsertapplication_identifier, region, ConfigurationProfileIdentifier, EnvironmentIdentifier, FlagKey, AudienceRuleCreates an experiment definition in AppConfig. An experiment definition describes the purpose, scope, and operational configuration of an experiment, including the target audience, feature flag, and treatment configurations.
update_experiment_definitionupdateapplication_identifier, experiment_definition_identifier, regionUpdates an experiment definition. You can update treatments, the control, audience rules, and other properties. You cannot update an experiment definition while an experiment run is active.
delete_experiment_definitiondeleteapplication_identifier, experiment_definition_identifier, regiondelete_typeDeletes an experiment definition. You can archive the definition to hide it from the active list while preserving it for future reference, or permanently delete it along with all associated run history.
start_experiment_runexecapplication_identifier, experiment_definition_identifier, regionStarts an experiment run for the specified experiment definition. An experiment run delivers treatments to the target audience and collects metrics. You can start multiple experiment runs from the same experiment definition. Billing for this experiment begins when you call this operation and continues until the experiment is stopped. For pricing details, see AppConfig pricing.
stop_experiment_runexecapplication_identifier, experiment_definition_identifier, run, regionStops a running experiment. Stopping an experiment run ends audience exposure and returns users to the currently deployed feature flag configuration.

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
application_identifierstringThe application ID or name.
experiment_definition_identifierstringThe experiment definition ID or name.
regionstringAWS region (default: us-east-1)
runintegerThe run number to stop.
application_identifierstringThe application ID or name to filter results.
configuration_profile_identifierstringThe configuration profile ID or name to filter results.
delete_typestringThe type of deletion to perform. Valid values include archive (hide but preserve) and permanent (delete permanently).
environment_identifierstringThe environment ID or name to filter results.
max_resultsintegerThe maximum number of items to return for this call.
next_tokenstringA token to start the list from a previously truncated response.
statusstringA filter for the experiment definition status.

SELECT examples

Retrieves information about an experiment definition.

SELECT
application_id,
audience_description,
audience_rule,
configuration_profile_id,
control,
created_at,
environment_id,
flag_key,
hypothesis,
id,
kms_key_identifier,
launch_criteria,
name,
status,
treatments,
updated_at
FROM aws.appconfig.experiment_definitions
WHERE application_identifier = '{{ application_identifier }}' -- required
AND experiment_definition_identifier = '{{ experiment_definition_identifier }}' -- required
AND region = '{{ region }}' -- required
;

INSERT examples

Creates an experiment definition in AppConfig. An experiment definition describes the purpose, scope, and operational configuration of an experiment, including the target audience, feature flag, and treatment configurations.

INSERT INTO aws.appconfig.experiment_definitions (
Name,
ConfigurationProfileIdentifier,
EnvironmentIdentifier,
FlagKey,
Treatments,
Control,
AudienceRule,
Hypothesis,
AudienceDescription,
LaunchCriteria,
Tags,
application_identifier,
region
)
SELECT
'{{ Name }}',
'{{ ConfigurationProfileIdentifier }}' /* required */,
'{{ EnvironmentIdentifier }}' /* required */,
'{{ FlagKey }}' /* required */,
'{{ Treatments }}',
'{{ Control }}',
'{{ AudienceRule }}' /* required */,
'{{ Hypothesis }}',
'{{ AudienceDescription }}',
'{{ LaunchCriteria }}',
'{{ Tags }}',
'{{ application_identifier }}',
'{{ region }}'
RETURNING
application_id,
audience_description,
audience_rule,
configuration_profile_id,
control,
created_at,
environment_id,
flag_key,
hypothesis,
id,
kms_key_identifier,
launch_criteria,
name,
status,
treatments,
updated_at
;

UPDATE examples

Updates an experiment definition. You can update treatments, the control, audience rules, and other properties. You cannot update an experiment definition while an experiment run is active.

UPDATE aws.appconfig.experiment_definitions
SET
Treatments = '{{ Treatments }}',
Control = '{{ Control }}',
Hypothesis = '{{ Hypothesis }}',
AudienceRule = '{{ AudienceRule }}',
AudienceDescription = '{{ AudienceDescription }}',
LaunchCriteria = '{{ LaunchCriteria }}'
WHERE
application_identifier = '{{ application_identifier }}' --required
AND experiment_definition_identifier = '{{ experiment_definition_identifier }}' --required
AND region = '{{ region }}' --required
RETURNING
application_id,
audience_description,
audience_rule,
configuration_profile_id,
control,
created_at,
environment_id,
flag_key,
hypothesis,
id,
kms_key_identifier,
launch_criteria,
name,
status,
treatments,
updated_at;

DELETE examples

Deletes an experiment definition. You can archive the definition to hide it from the active list while preserving it for future reference, or permanently delete it along with all associated run history.

DELETE FROM aws.appconfig.experiment_definitions
WHERE application_identifier = '{{ application_identifier }}' --required
AND experiment_definition_identifier = '{{ experiment_definition_identifier }}' --required
AND region = '{{ region }}' --required
AND delete_type = '{{ delete_type }}'
;

Lifecycle Methods

Starts an experiment run for the specified experiment definition. An experiment run delivers treatments to the target audience and collects metrics. You can start multiple experiment runs from the same experiment definition. Billing for this experiment begins when you call this operation and continues until the experiment is stopped. For pricing details, see AppConfig pricing.

EXEC aws.appconfig.experiment_definitions.start_experiment_run
@application_identifier='{{ application_identifier }}' --required,
@experiment_definition_identifier='{{ experiment_definition_identifier }}' --required,
@region='{{ region }}' --required
@@json=
'{
"Description": "{{ Description }}",
"ExposurePercentage": {{ ExposurePercentage }},
"TreatmentOverrides": "{{ TreatmentOverrides }}",
"Tags": "{{ Tags }}",
"DeploymentParameters": "{{ DeploymentParameters }}"
}'
;