Class CfnExperiment

java.lang.Object
software.amazon.jsii.JsiiObject
All Implemented Interfaces:
IConstruct, IDependable, IInspectable, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct

@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)", date="2023-06-19T16:29:56.708Z") @Stability(Stable) public class CfnExperiment extends CfnResource implements IInspectable
A CloudFormation AWS::Evidently::Experiment.

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();
 
  • Field Details

    • CFN_RESOURCE_TYPE_NAME

      @Stability(Stable) public static final String 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 Construct scope, @NotNull String id, @NotNull CfnExperimentProps props)
      Create a new AWS::Evidently::Experiment.

      Parameters:
      scope -
      • scope in which this resource is defined.
      This parameter is required.
      id -
      • scoped id of the resource.
      This parameter is required.
      props -
      • resource properties.
      This parameter is required.
  • Method Details

    • inspect

      @Stability(Stable) public void inspect(@NotNull TreeInspector inspector)
      Examines the CloudFormation resource and discloses attributes.

      Specified by:
      inspect in interface IInspectable
      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:
      renderProperties in class CfnResource
      Parameters:
      props - This parameter is required.
    • getAttrArn

      @Stability(Stable) @NotNull public String getAttrArn()
      The ARN of the experiment.

      For example, arn:aws:evidently:us-west-2:0123455678912:project/myProject/experiment/myExperiment

    • getCfnProperties

      @Stability(Stable) @NotNull protected Map<String,Object> getCfnProperties()
      Overrides:
      getCfnProperties in class CfnResource
    • getTags

      @Stability(Stable) @NotNull public TagManager getTags()
      Assigns one or more tags (key-value pairs) to the experiment.

      Tags can help you organize and categorize your resources. You can also use them to scope user permissions by granting a user permission to access or change only resources with certain tag values.

      Tags don't have any semantic meaning to AWS and are interpreted strictly as strings of characters.

      You can associate as many as 50 tags with an experiment.

      For more information, see Tagging AWS resources .

    • getMetricGoals

      @Stability(Stable) @NotNull public Object 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.

      You can use up to three metrics in an experiment.

    • setMetricGoals

      @Stability(Stable) public void setMetricGoals(@NotNull 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.

      You can use up to three metrics in an experiment.

    • setMetricGoals

      @Stability(Stable) public void setMetricGoals(@NotNull 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.

      You can use up to three metrics in an experiment.

    • getName

      @Stability(Stable) @NotNull public String getName()
      A name for the new experiment.
    • setName

      @Stability(Stable) public void setName(@NotNull String value)
      A name for the new experiment.
    • getOnlineAbConfig

      @Stability(Stable) @NotNull public Object getOnlineAbConfig()
      A structure that contains the configuration of which variation to use as the "control" version.

      The "control" version is used for comparison with other variations. This structure also specifies how much experiment traffic is allocated to each variation.

    • setOnlineAbConfig

      @Stability(Stable) public void setOnlineAbConfig(@NotNull IResolvable value)
      A structure that contains the configuration of which variation to use as the "control" version.

      The "control" version is used for comparison with other variations. This structure also specifies how much experiment traffic is allocated to each variation.

    • 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.

      The "control" version is used for comparison with other variations. This structure also specifies how much experiment traffic is allocated to each variation.

    • getProject

      @Stability(Stable) @NotNull public String getProject()
      The name or the ARN of the project where this experiment is to be created.
    • setProject

      @Stability(Stable) public void setProject(@NotNull String value)
      The name or the ARN of the project where this experiment is to be created.
    • getTreatments

      @Stability(Stable) @NotNull public Object getTreatments()
      An array of structures that describe the configuration of each feature variation used in the experiment.
    • setTreatments

      @Stability(Stable) public void setTreatments(@NotNull IResolvable value)
      An array of structures that describe the configuration of each feature variation used in the experiment.
    • setTreatments

      @Stability(Stable) public void setTreatments(@NotNull List<Object> value)
      An array of structures that describe the configuration of each feature variation used in the experiment.
    • getDescription

      @Stability(Stable) @Nullable public String getDescription()
      An optional description of the experiment.
    • setDescription

      @Stability(Stable) public void setDescription(@Nullable String value)
      An optional description of the experiment.
    • getRandomizationSalt

      @Stability(Stable) @Nullable public String 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.

      This randomization ID is a combination of the entity ID and randomizationSalt . If you omit randomizationSalt , Evidently uses the experiment name as the randomizationSalt .

    • setRandomizationSalt

      @Stability(Stable) public void setRandomizationSalt(@Nullable 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.

      This randomization ID is a combination of the entity ID and randomizationSalt . If you omit randomizationSalt , Evidently uses the experiment name as the randomizationSalt .

    • getRemoveSegment

      @Stability(Stable) @Nullable public Object getRemoveSegment()
      Set this to true to remove the segment that is associated with this experiment.

      You can't use this parameter if the experiment is currently running.

    • setRemoveSegment

      @Stability(Stable) public void setRemoveSegment(@Nullable Boolean value)
      Set this to true to remove the segment that is associated with this experiment.

      You can't use this parameter if the experiment is currently running.

    • setRemoveSegment

      @Stability(Stable) public void setRemoveSegment(@Nullable IResolvable value)
      Set this to true to remove the segment that is associated with this experiment.

      You can't use this parameter if the experiment is currently running.

    • getRunningStatus

      @Stability(Stable) @Nullable public Object getRunningStatus()
      A structure that you can use to start and stop the experiment.
    • setRunningStatus

      @Stability(Stable) public void setRunningStatus(@Nullable IResolvable value)
      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

      @Stability(Stable) @Nullable public Number getSamplingRate()
      The portion of the available audience that you want to allocate to this experiment, in thousandths of a percent.

      The available audience is the total audience minus the audience that you have allocated to overrides or current launches of this feature.

      This is represented in thousandths of a percent. For example, specify 10,000 to allocate 10% of the available audience.

    • setSamplingRate

      @Stability(Stable) public void setSamplingRate(@Nullable Number value)
      The portion of the available audience that you want to allocate to this experiment, in thousandths of a percent.

      The available audience is the total audience minus the audience that you have allocated to overrides or current launches of this feature.

      This is represented in thousandths of a percent. For example, specify 10,000 to allocate 10% of the available audience.

    • getSegment

      @Stability(Stable) @Nullable public String getSegment()
      Specifies an audience segment to use in the experiment.

      When a segment is used in an experiment, only user sessions that match the segment pattern are used in the experiment.

      For more information, see Segment rule pattern syntax .

    • setSegment

      @Stability(Stable) public void setSegment(@Nullable String value)
      Specifies an audience segment to use in the experiment.

      When a segment is used in an experiment, only user sessions that match the segment pattern are used in the experiment.

      For more information, see Segment rule pattern syntax .