CfnLaunch
- class aws_cdk.aws_evidently.CfnLaunch(scope, id, *, groups, name, project, scheduled_splits_config, description=None, execution_status=None, metric_monitors=None, randomization_salt=None, tags=None)
Bases:
CfnResource
Creates or updates a launch of a given feature.
Before you create a launch, you must create the feature to use for the launch.
You can use a launch to safely validate new features by serving them to a specified percentage of your users while you roll out the feature. You can monitor the performance of the new feature to help you decide when to ramp up traffic to more users. This helps you reduce risk and identify unintended consequences before you fully launch the feature.
- See:
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-evidently-launch.html
- CloudformationResource:
AWS::Evidently::Launch
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_evidently as evidently cfn_launch = evidently.CfnLaunch(self, "MyCfnLaunch", groups=[evidently.CfnLaunch.LaunchGroupObjectProperty( feature="feature", group_name="groupName", variation="variation", # the properties below are optional description="description" )], name="name", project="project", scheduled_splits_config=[evidently.CfnLaunch.StepConfigProperty( group_weights=[evidently.CfnLaunch.GroupToWeightProperty( group_name="groupName", split_weight=123 )], start_time="startTime", # the properties below are optional segment_overrides=[evidently.CfnLaunch.SegmentOverrideProperty( evaluation_order=123, segment="segment", weights=[evidently.CfnLaunch.GroupToWeightProperty( group_name="groupName", split_weight=123 )] )] )], # the properties below are optional description="description", execution_status=evidently.CfnLaunch.ExecutionStatusObjectProperty( status="status", # the properties below are optional desired_state="desiredState", reason="reason" ), metric_monitors=[evidently.CfnLaunch.MetricDefinitionObjectProperty( entity_id_key="entityIdKey", metric_name="metricName", value_key="valueKey", # the properties below are optional event_pattern="eventPattern", unit_label="unitLabel" )], randomization_salt="randomizationSalt", tags=[CfnTag( key="key", value="value" )] )
- Parameters:
scope (
Construct
) – Scope in which this resource is defined.id (
str
) – Construct identifier for this resource (unique in its scope).groups (
Union
[IResolvable
,Sequence
[Union
[IResolvable
,LaunchGroupObjectProperty
,Dict
[str
,Any
]]]]) – An array of structures that contains the feature and variations that are to be used for the launch. You can up to five launch groups in a launch.name (
str
) – The name for the launch. It can include up to 127 characters.project (
str
) – The name or ARN of the project that you want to create the launch in.scheduled_splits_config (
Union
[IResolvable
,Sequence
[Union
[IResolvable
,StepConfigProperty
,Dict
[str
,Any
]]]]) – An array of structures that define the traffic allocation percentages among the feature variations during each step of the launch.description (
Optional
[str
]) – An optional description for the launch.execution_status (
Union
[IResolvable
,ExecutionStatusObjectProperty
,Dict
[str
,Any
],None
]) – A structure that you can use to start and stop the launch.metric_monitors (
Union
[IResolvable
,Sequence
[Union
[IResolvable
,MetricDefinitionObjectProperty
,Dict
[str
,Any
]]],None
]) – An array of structures that define the metrics that will be used to monitor the launch performance. You can have up to three metric monitors in the array.randomization_salt (
Optional
[str
]) – When Evidently assigns a particular user session to a launch, 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 andrandomizationSalt
. If you omitrandomizationSalt
, Evidently uses the launch name as therandomizationsSalt
.tags (
Optional
[Sequence
[Union
[CfnTag
,Dict
[str
,Any
]]]]) – Assigns one or more tags (key-value pairs) to the launch. 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 a launch. For more information, see Tagging AWS resources .
Methods
- add_deletion_override(path)
Syntactic sugar for
addOverride(path, undefined)
.- Parameters:
path (
str
) – The path of the value to delete.- Return type:
None
- add_dependency(target)
Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
This can be used for resources across stacks (or nested stack) boundaries and the dependency will automatically be transferred to the relevant scope.
- Parameters:
target (
CfnResource
) –- Return type:
None
- add_depends_on(target)
(deprecated) Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
- Parameters:
target (
CfnResource
) –- Deprecated:
use addDependency
- Stability:
deprecated
- Return type:
None
- add_metadata(key, value)
Add a value to the CloudFormation Resource Metadata.
- Parameters:
key (
str
) –value (
Any
) –
- See:
- Return type:
None
Note that this is a different set of metadata from CDK node metadata; this metadata ends up in the stack template under the resource, whereas CDK node metadata ends up in the Cloud Assembly.
- add_override(path, value)
Adds an override to the synthesized CloudFormation resource.
To add a property override, either use
addPropertyOverride
or prefixpath
with “Properties.” (i.e.Properties.TopicName
).If the override is nested, separate each nested level using a dot (.) in the path parameter. If there is an array as part of the nesting, specify the index in the path.
To include a literal
.
in the property name, prefix with a\
. In most programming languages you will need to write this as"\\."
because the\
itself will need to be escaped.For example:
cfn_resource.add_override("Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes", ["myattribute"]) cfn_resource.add_override("Properties.GlobalSecondaryIndexes.1.ProjectionType", "INCLUDE")
would add the overrides Example:
"Properties": { "GlobalSecondaryIndexes": [ { "Projection": { "NonKeyAttributes": [ "myattribute" ] ... } ... }, { "ProjectionType": "INCLUDE" ... }, ] ... }
The
value
argument toaddOverride
will not be processed or translated in any way. Pass raw JSON values in here with the correct capitalization for CloudFormation. If you pass CDK classes or structs, they will be rendered with lowercased key names, and CloudFormation will reject the template.- Parameters:
path (
str
) –The path of the property, you can use dot notation to override values in complex types. Any intermediate keys will be created as needed.
value (
Any
) –The value. Could be primitive or complex.
- Return type:
None
- add_property_deletion_override(property_path)
Adds an override that deletes the value of a property from the resource definition.
- Parameters:
property_path (
str
) – The path to the property.- Return type:
None
- add_property_override(property_path, value)
Adds an override to a resource property.
Syntactic sugar for
addOverride("Properties.<...>", value)
.- Parameters:
property_path (
str
) – The path of the property.value (
Any
) – The value.
- Return type:
None
- apply_removal_policy(policy=None, *, apply_to_update_replace_policy=None, default=None)
Sets the deletion policy of the resource based on the removal policy specified.
The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you’ve removed it from the CDK application or because you’ve made a change that requires the resource to be replaced.
The resource can be deleted (
RemovalPolicy.DESTROY
), or left in your AWS account for data recovery and cleanup later (RemovalPolicy.RETAIN
). In some cases, a snapshot can be taken of the resource prior to deletion (RemovalPolicy.SNAPSHOT
). A list of resources that support this policy can be found in the following link:- Parameters:
policy (
Optional
[RemovalPolicy
]) –apply_to_update_replace_policy (
Optional
[bool
]) – Apply the same deletion policy to the resource’s “UpdateReplacePolicy”. Default: truedefault (
Optional
[RemovalPolicy
]) – The default policy to apply in case the removal policy is not defined. Default: - Default value is resource specific. To determine the default value for a resource, please consult that specific resource’s documentation.
- See:
- Return type:
None
- get_att(attribute_name, type_hint=None)
Returns a token for an runtime attribute of this resource.
Ideally, use generated attribute accessors (e.g.
resource.arn
), but this can be used for future compatibility in case there is no generated attribute.- Parameters:
attribute_name (
str
) – The name of the attribute.type_hint (
Optional
[ResolutionTypeHint
]) –
- Return type:
- get_metadata(key)
Retrieve a value value from the CloudFormation Resource Metadata.
- Parameters:
key (
str
) –- See:
- Return type:
Any
Note that this is a different set of metadata from CDK node metadata; this metadata ends up in the stack template under the resource, whereas CDK node metadata ends up in the Cloud Assembly.
- inspect(inspector)
Examines the CloudFormation resource and discloses attributes.
- Parameters:
inspector (
TreeInspector
) – tree inspector to collect and process attributes.- Return type:
None
- obtain_dependencies()
Retrieves an array of resources this resource depends on.
This assembles dependencies on resources across stacks (including nested stacks) automatically.
- Return type:
List
[Union
[Stack
,CfnResource
]]
- obtain_resource_dependencies()
Get a shallow copy of dependencies between this resource and other resources in the same stack.
- Return type:
List
[CfnResource
]
- override_logical_id(new_logical_id)
Overrides the auto-generated logical ID with a specific ID.
- Parameters:
new_logical_id (
str
) – The new logical ID to use for this stack element.- Return type:
None
- remove_dependency(target)
Indicates that this resource no longer depends on another resource.
This can be used for resources across stacks (including nested stacks) and the dependency will automatically be removed from the relevant scope.
- Parameters:
target (
CfnResource
) –- Return type:
None
- replace_dependency(target, new_target)
Replaces one dependency with another.
- Parameters:
target (
CfnResource
) – The dependency to replace.new_target (
CfnResource
) – The new dependency to add.
- Return type:
None
- to_string()
Returns a string representation of this construct.
- Return type:
str
- Returns:
a string representation of this resource
Attributes
- CFN_RESOURCE_TYPE_NAME = 'AWS::Evidently::Launch'
- attr_arn
The ARN of the launch.
For example,
arn:aws:evidently:us-west-2:0123455678912:project/myProject/launch/myLaunch
- CloudformationAttribute:
Arn
- cfn_options
Options for this resource, such as condition, update policy etc.
- cfn_resource_type
AWS resource type.
- creation_stack
return:
the stack trace of the point where this Resource was created from, sourced from the +metadata+ entry typed +aws:cdk:logicalId+, and with the bottom-most node +internal+ entries filtered.
- description
An optional description for the launch.
- execution_status
A structure that you can use to start and stop the launch.
- groups
An array of structures that contains the feature and variations that are to be used for the launch.
- logical_id
The logical ID for this CloudFormation stack element.
The logical ID of the element is calculated from the path of the resource node in the construct tree.
To override this value, use
overrideLogicalId(newLogicalId)
.- Returns:
the logical ID as a stringified token. This value will only get resolved during synthesis.
- metric_monitors
An array of structures that define the metrics that will be used to monitor the launch performance.
- name
The name for the launch.
- node
The tree node.
- project
The name or ARN of the project that you want to create the launch in.
- randomization_salt
When Evidently assigns a particular user session to a launch, it must use a randomization ID to determine which variation the user session is served.
- ref
Return a string that will be resolved to a CloudFormation
{ Ref }
for this element.If, by any chance, the intrinsic reference of a resource is not a string, you could coerce it to an IResolvable through
Lazy.any({ produce: resource.ref })
.
- scheduled_splits_config
An array of structures that define the traffic allocation percentages among the feature variations during each step of the launch.
- stack
The stack in which this element is defined.
CfnElements must be defined within a stack scope (directly or indirectly).
- tags
Tag Manager which manages the tags for this resource.
- tags_raw
Assigns one or more tags (key-value pairs) to the launch.
Static Methods
- classmethod is_cfn_element(x)
Returns
true
if a construct is a stack element (i.e. part of the synthesized cloudformation template).Uses duck-typing instead of
instanceof
to allow stack elements from different versions of this library to be included in the same stack.- Parameters:
x (
Any
) –- Return type:
bool
- Returns:
The construct as a stack element or undefined if it is not a stack element.
- classmethod is_cfn_resource(x)
Check whether the given object is a CfnResource.
- Parameters:
x (
Any
) –- Return type:
bool
- classmethod is_construct(x)
Checks if
x
is a construct.Use this method instead of
instanceof
to properly detectConstruct
instances, even when the construct library is symlinked.Explanation: in JavaScript, multiple copies of the
constructs
library on disk are seen as independent, completely different libraries. As a consequence, the classConstruct
in each copy of theconstructs
library is seen as a different class, and an instance of one class will not test asinstanceof
the other class.npm install
will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of theconstructs
library can be accidentally installed, andinstanceof
will behave unpredictably. It is safest to avoid usinginstanceof
, and using this type-testing method instead.- Parameters:
x (
Any
) – Any object.- Return type:
bool
- Returns:
true if
x
is an object created from a class which extendsConstruct
.
ExecutionStatusObjectProperty
- class CfnLaunch.ExecutionStatusObjectProperty(*, status, desired_state=None, reason=None)
Bases:
object
Use this structure to start and stop the launch.
- Parameters:
status (
str
) – To start the launch now, specifySTART
for this parameter. If this launch is currently running and you want to stop it now, specifySTOP
.desired_state (
Optional
[str
]) – If you are using AWS CloudFormation to stop this launch, specify eitherCOMPLETED
orCANCELLED
here to indicate how to classify this experiment. If you omit this parameter, the default ofCOMPLETED
is used.reason (
Optional
[str
]) – If you are using AWS CloudFormation to stop this launch, this is an optional field that you can use to record why the launch is being stopped or cancelled.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_evidently as evidently execution_status_object_property = evidently.CfnLaunch.ExecutionStatusObjectProperty( status="status", # the properties below are optional desired_state="desiredState", reason="reason" )
Attributes
- desired_state
If you are using AWS CloudFormation to stop this launch, specify either
COMPLETED
orCANCELLED
here to indicate how to classify this experiment.If you omit this parameter, the default of
COMPLETED
is used.
- reason
If you are using AWS CloudFormation to stop this launch, this is an optional field that you can use to record why the launch is being stopped or cancelled.
- status
To start the launch now, specify
START
for this parameter.If this launch is currently running and you want to stop it now, specify
STOP
.
GroupToWeightProperty
- class CfnLaunch.GroupToWeightProperty(*, group_name, split_weight)
Bases:
object
A structure containing the percentage of launch traffic to allocate to one launch group.
- Parameters:
group_name (
str
) – The name of the launch group. It can include up to 127 characters.split_weight (
Union
[int
,float
]) – The portion of launch traffic to allocate to this launch group. This is represented in thousandths of a percent. For example, specify 20,000 to allocate 20% of the launch audience to this launch group.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_evidently as evidently group_to_weight_property = evidently.CfnLaunch.GroupToWeightProperty( group_name="groupName", split_weight=123 )
Attributes
- group_name
The name of the launch group.
It can include up to 127 characters.
- split_weight
The portion of launch traffic to allocate to this launch group.
This is represented in thousandths of a percent. For example, specify 20,000 to allocate 20% of the launch audience to this launch group.
LaunchGroupObjectProperty
- class CfnLaunch.LaunchGroupObjectProperty(*, feature, group_name, variation, description=None)
Bases:
object
A structure that defines one launch group in a launch.
A launch group is a variation of the feature that you are including in the launch.
- Parameters:
feature (
str
) – The feature that this launch is using.group_name (
str
) – A name for this launch group. It can include up to 127 characters.variation (
str
) – The feature variation to use for this launch group.description (
Optional
[str
]) – A description of the launch group.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_evidently as evidently launch_group_object_property = evidently.CfnLaunch.LaunchGroupObjectProperty( feature="feature", group_name="groupName", variation="variation", # the properties below are optional description="description" )
Attributes
- description
A description of the launch group.
- feature
The feature that this launch is using.
- group_name
A name for this launch group.
It can include up to 127 characters.
- variation
The feature variation to use for this launch group.
MetricDefinitionObjectProperty
- class CfnLaunch.MetricDefinitionObjectProperty(*, entity_id_key, metric_name, value_key, event_pattern=None, unit_label=None)
Bases:
object
This structure defines a metric that you want to use to evaluate the variations during a launch or experiment.
- Parameters:
entity_id_key (
str
) – The entity, such as a user or session, that does an action that causes a metric value to be recorded. An example isuserDetails.userID
.metric_name (
str
) – A name for the metric. It can include up to 255 characters.value_key (
str
) – The value that is tracked to produce the metric.event_pattern (
Optional
[str
]) – The EventBridge event pattern that defines how the metric is recorded. For more information about EventBridge event patterns, see Amazon EventBridge event patterns .unit_label (
Optional
[str
]) – A label for the units that the metric is measuring.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_evidently as evidently metric_definition_object_property = evidently.CfnLaunch.MetricDefinitionObjectProperty( entity_id_key="entityIdKey", metric_name="metricName", value_key="valueKey", # the properties below are optional event_pattern="eventPattern", unit_label="unitLabel" )
Attributes
- entity_id_key
The entity, such as a user or session, that does an action that causes a metric value to be recorded.
An example is
userDetails.userID
.
- event_pattern
The EventBridge event pattern that defines how the metric is recorded.
For more information about EventBridge event patterns, see Amazon EventBridge event patterns .
- metric_name
A name for the metric.
It can include up to 255 characters.
- unit_label
A label for the units that the metric is measuring.
- value_key
The value that is tracked to produce the metric.
SegmentOverrideProperty
- class CfnLaunch.SegmentOverrideProperty(*, evaluation_order, segment, weights)
Bases:
object
Use this structure to specify different traffic splits for one or more audience segments .
A segment is a portion of your audience that share one or more characteristics. Examples could be Chrome browser users, users in Europe, or Firefox browser users in Europe who also fit other criteria that your application collects, such as age.
For more information, see Use segments to focus your audience .
This sructure is an array of up to six segment override objects. Each of these objects specifies a segment that you have already created, and defines the traffic split for that segment.
- Parameters:
evaluation_order (
Union
[int
,float
]) – A number indicating the order to use to evaluate segment overrides, if there are more than one. Segment overrides with lower numbers are evaluated first.segment (
str
) – The ARN of the segment to use for this override.weights (
Union
[IResolvable
,Sequence
[Union
[IResolvable
,GroupToWeightProperty
,Dict
[str
,Any
]]]]) – The traffic allocation percentages among the feature variations to assign to this segment. This is a set of key-value pairs. The keys are variation names. The values represent the amount of traffic to allocate to that variation for this segment. This is expressed in thousandths of a percent, so a weight of 50000 represents 50% of traffic.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_evidently as evidently segment_override_property = evidently.CfnLaunch.SegmentOverrideProperty( evaluation_order=123, segment="segment", weights=[evidently.CfnLaunch.GroupToWeightProperty( group_name="groupName", split_weight=123 )] )
Attributes
- evaluation_order
A number indicating the order to use to evaluate segment overrides, if there are more than one.
Segment overrides with lower numbers are evaluated first.
- segment
The ARN of the segment to use for this override.
- weights
The traffic allocation percentages among the feature variations to assign to this segment.
This is a set of key-value pairs. The keys are variation names. The values represent the amount of traffic to allocate to that variation for this segment. This is expressed in thousandths of a percent, so a weight of 50000 represents 50% of traffic.
StepConfigProperty
- class CfnLaunch.StepConfigProperty(*, group_weights, start_time, segment_overrides=None)
Bases:
object
A structure that defines when each step of the launch is to start, and how much launch traffic is to be allocated to each variation during each step.
- Parameters:
group_weights (
Union
[IResolvable
,Sequence
[Union
[IResolvable
,GroupToWeightProperty
,Dict
[str
,Any
]]]]) – An array of structures that define how much launch traffic to allocate to each launch group during this step of the launch.start_time (
str
) – The date and time to start this step of the launch. Use UTC format,yyyy-MM-ddTHH:mm:ssZ
. For example,2025-11-25T23:59:59Z
segment_overrides (
Union
[IResolvable
,Sequence
[Union
[IResolvable
,SegmentOverrideProperty
,Dict
[str
,Any
]]],None
]) –An array of structures that you can use to specify different traffic splits for one or more audience segments . A segment is a portion of your audience that share one or more characteristics. Examples could be Chrome browser users, users in Europe, or Firefox browser users in Europe who also fit other criteria that your application collects, such as age. For more information, see Use segments to focus your audience .
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk import aws_evidently as evidently step_config_property = evidently.CfnLaunch.StepConfigProperty( group_weights=[evidently.CfnLaunch.GroupToWeightProperty( group_name="groupName", split_weight=123 )], start_time="startTime", # the properties below are optional segment_overrides=[evidently.CfnLaunch.SegmentOverrideProperty( evaluation_order=123, segment="segment", weights=[evidently.CfnLaunch.GroupToWeightProperty( group_name="groupName", split_weight=123 )] )] )
Attributes
- group_weights
An array of structures that define how much launch traffic to allocate to each launch group during this step of the launch.
- segment_overrides
An array of structures that you can use to specify different traffic splits for one or more audience segments .
A segment is a portion of your audience that share one or more characteristics. Examples could be Chrome browser users, users in Europe, or Firefox browser users in Europe who also fit other criteria that your application collects, such as age.
For more information, see Use segments to focus your audience .
- start_time
The date and time to start this step of the launch.
Use UTC format,
yyyy-MM-ddTHH:mm:ssZ
. For example,2025-11-25T23:59:59Z