Class CfnExperiment
java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.CfnElement
software.amazon.awscdk.CfnRefElement
software.amazon.awscdk.CfnResource
software.amazon.awscdk.services.evidently.CfnExperiment
- All Implemented Interfaces:
IInspectable,ITaggable,IExperimentRef,software.amazon.jsii.JsiiSerializable,software.constructs.IConstruct,software.constructs.IDependable
@Generated(value="jsii-pacmak/1.113.0 (build fc68b25)",
date="2025-10-14T12:28:11.340Z")
@Stability(Stable)
public class CfnExperiment
extends CfnResource
implements IInspectable, IExperimentRef, ITaggable
Creates or updates an Evidently experiment .
Before you create an experiment, you must create the feature to use for the experiment.
An experiment helps you make feature design decisions based on evidence and data. An experiment can test as many as five variations at once. Evidently collects experiment data and analyzes it by statistical methods, and provides clear recommendations about which variations perform better.
Example:
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.evidently.*;
CfnExperiment cfnExperiment = CfnExperiment.Builder.create(this, "MyCfnExperiment")
.metricGoals(List.of(MetricGoalObjectProperty.builder()
.desiredChange("desiredChange")
.entityIdKey("entityIdKey")
.metricName("metricName")
.valueKey("valueKey")
// the properties below are optional
.eventPattern("eventPattern")
.unitLabel("unitLabel")
.build()))
.name("name")
.onlineAbConfig(OnlineAbConfigObjectProperty.builder()
.controlTreatmentName("controlTreatmentName")
.treatmentWeights(List.of(TreatmentToWeightProperty.builder()
.splitWeight(123)
.treatment("treatment")
.build()))
.build())
.project("project")
.treatments(List.of(TreatmentObjectProperty.builder()
.feature("feature")
.treatmentName("treatmentName")
.variation("variation")
// the properties below are optional
.description("description")
.build()))
// the properties below are optional
.description("description")
.randomizationSalt("randomizationSalt")
.removeSegment(false)
.runningStatus(RunningStatusObjectProperty.builder()
.status("status")
// the properties below are optional
.analysisCompleteTime("analysisCompleteTime")
.desiredState("desiredState")
.reason("reason")
.build())
.samplingRate(123)
.segment("segment")
.tags(List.of(CfnTag.builder()
.key("key")
.value("value")
.build()))
.build();
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classA fluent builder forCfnExperiment.static interfaceUse this structure to tell Evidently whether higher or lower values are desired for a metric that is used in an experiment.static interfaceA structure that contains the configuration of which variation to use as the "control" version.static interfaceUse this structure to start and stop the experiment.static interfaceA structure that defines one treatment in an experiment.static interfaceThis structure defines how much experiment traffic to allocate to one treatment used in the experiment.Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.services.evidently.IExperimentRef
IExperimentRef.Jsii$Default, IExperimentRef.Jsii$ProxyNested classes/interfaces inherited from interface software.amazon.awscdk.IInspectable
IInspectable.Jsii$Default, IInspectable.Jsii$ProxyNested classes/interfaces inherited from interface software.amazon.awscdk.ITaggable
ITaggable.Jsii$Default, ITaggable.Jsii$Proxy -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe CloudFormation resource type name for this resource class. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCfnExperiment(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedCfnExperiment(software.amazon.jsii.JsiiObjectRef objRef) CfnExperiment(software.constructs.Construct scope, String id, CfnExperimentProps props) -
Method Summary
Modifier and TypeMethodDescriptionThe ARN of the experiment.An optional description of the experiment.A reference to a Experiment resource.An array of structures that defines the metrics used for the experiment, and whether a higher or lower value for each metric is the goal.getName()A name for the new experiment.A structure that contains the configuration of which variation to use as the "control" version.The name or the ARN of the project where this experiment is to be created.When Evidently assigns a particular user session to an experiment, it must use a randomization ID to determine which variation the user session is served.Set this totrueto remove the segment that is associated with this experiment.A structure that you can use to start and stop the experiment.The portion of the available audience that you want to allocate to this experiment, in thousandths of a percent.Specifies an audience segment to use in the experiment.getTags()Tag Manager which manages the tags for this resource.Assigns one or more tags (key-value pairs) to the experiment.An array of structures that describe the configuration of each feature variation used in the experiment.voidinspect(TreeInspector inspector) Examines the CloudFormation resource and discloses attributes.renderProperties(Map<String, Object> props) voidsetDescription(String value) An optional description of the experiment.voidsetMetricGoals(List<Object> value) An array of structures that defines the metrics used for the experiment, and whether a higher or lower value for each metric is the goal.voidsetMetricGoals(IResolvable value) An array of structures that defines the metrics used for the experiment, and whether a higher or lower value for each metric is the goal.voidA name for the new experiment.voidsetOnlineAbConfig(IResolvable value) A structure that contains the configuration of which variation to use as the "control" version.voidA structure that contains the configuration of which variation to use as the "control" version.voidsetProject(String value) The name or the ARN of the project where this experiment is to be created.voidsetRandomizationSalt(String value) When Evidently assigns a particular user session to an experiment, it must use a randomization ID to determine which variation the user session is served.voidsetRemoveSegment(Boolean value) Set this totrueto remove the segment that is associated with this experiment.voidsetRemoveSegment(IResolvable value) Set this totrueto remove the segment that is associated with this experiment.voidsetRunningStatus(IResolvable value) A structure that you can use to start and stop the experiment.voidA structure that you can use to start and stop the experiment.voidsetSamplingRate(Number value) The portion of the available audience that you want to allocate to this experiment, in thousandths of a percent.voidsetSegment(String value) Specifies an audience segment to use in the experiment.voidsetTagsRaw(List<CfnTag> value) Assigns one or more tags (key-value pairs) to the experiment.voidsetTreatments(List<Object> value) An array of structures that describe the configuration of each feature variation used in the experiment.voidsetTreatments(IResolvable value) An array of structures that describe the configuration of each feature variation used in the experiment.Methods inherited from class software.amazon.awscdk.CfnResource
addDeletionOverride, addDependency, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getAtt, getCfnOptions, getCfnResourceType, getMetadata, getUpdatedProperites, getUpdatedProperties, isCfnResource, obtainDependencies, obtainResourceDependencies, removeDependency, replaceDependency, shouldSynthesize, toString, validatePropertiesMethods inherited from class software.amazon.awscdk.CfnRefElement
getRefMethods inherited from class software.amazon.awscdk.CfnElement
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalIdMethods inherited from class software.constructs.Construct
getNode, isConstructMethods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface software.constructs.IConstruct
getNodeMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
-
-
Constructor Details
-
CfnExperiment
protected CfnExperiment(software.amazon.jsii.JsiiObjectRef objRef) -
CfnExperiment
protected CfnExperiment(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
CfnExperiment
@Stability(Stable) public CfnExperiment(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull CfnExperimentProps props) - Parameters:
scope- Scope in which this resource is defined. This parameter is required.id- Construct identifier for this resource (unique in its scope). This parameter is required.props- Resource properties. This parameter is required.
-
-
Method Details
-
inspect
Examines the CloudFormation resource and discloses attributes.- Specified by:
inspectin interfaceIInspectable- Parameters:
inspector- tree inspector to collect and process attributes. This parameter is required.
-
renderProperties
@Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String, Object> props) - Overrides:
renderPropertiesin classCfnResource- Parameters:
props- This parameter is required.
-
getAttrArn
The ARN of the experiment.For example,
arn:aws:evidently:us-west-2:0123455678912:project/myProject/experiment/myExperiment -
getCfnProperties
- Overrides:
getCfnPropertiesin classCfnResource
-
getExperimentRef
A reference to a Experiment resource.- Specified by:
getExperimentRefin interfaceIExperimentRef
-
getTags
Tag Manager which manages the tags for this resource. -
getMetricGoals
An array of structures that defines the metrics used for the experiment, and whether a higher or lower value for each metric is the goal. -
setMetricGoals
An array of structures that defines the metrics used for the experiment, and whether a higher or lower value for each metric is the goal. -
setMetricGoals
An array of structures that defines the metrics used for the experiment, and whether a higher or lower value for each metric is the goal. -
getName
A name for the new experiment. -
setName
A name for the new experiment. -
getOnlineAbConfig
A structure that contains the configuration of which variation to use as the "control" version. -
setOnlineAbConfig
A structure that contains the configuration of which variation to use as the "control" version. -
setOnlineAbConfig
@Stability(Stable) public void setOnlineAbConfig(@NotNull CfnExperiment.OnlineAbConfigObjectProperty value) A structure that contains the configuration of which variation to use as the "control" version. -
getProject
The name or the ARN of the project where this experiment is to be created. -
setProject
The name or the ARN of the project where this experiment is to be created. -
getTreatments
An array of structures that describe the configuration of each feature variation used in the experiment. -
setTreatments
An array of structures that describe the configuration of each feature variation used in the experiment. -
setTreatments
An array of structures that describe the configuration of each feature variation used in the experiment. -
getDescription
An optional description of the experiment. -
setDescription
An optional description of the experiment. -
getRandomizationSalt
When Evidently assigns a particular user session to an experiment, it must use a randomization ID to determine which variation the user session is served. -
setRandomizationSalt
When Evidently assigns a particular user session to an experiment, it must use a randomization ID to determine which variation the user session is served. -
getRemoveSegment
Set this totrueto remove the segment that is associated with this experiment. -
setRemoveSegment
Set this totrueto remove the segment that is associated with this experiment. -
setRemoveSegment
Set this totrueto remove the segment that is associated with this experiment. -
getRunningStatus
A structure that you can use to start and stop the experiment. -
setRunningStatus
A structure that you can use to start and stop the experiment. -
setRunningStatus
@Stability(Stable) public void setRunningStatus(@Nullable CfnExperiment.RunningStatusObjectProperty value) A structure that you can use to start and stop the experiment. -
getSamplingRate
The portion of the available audience that you want to allocate to this experiment, in thousandths of a percent. -
setSamplingRate
The portion of the available audience that you want to allocate to this experiment, in thousandths of a percent. -
getSegment
Specifies an audience segment to use in the experiment. -
setSegment
Specifies an audience segment to use in the experiment. -
getTagsRaw
Assigns one or more tags (key-value pairs) to the experiment. -
setTagsRaw
Assigns one or more tags (key-value pairs) to the experiment.
-