CfnLifecycleHookPropsMixin
- class aws_cdk.mixins_preview.aws_autoscaling.mixins.CfnLifecycleHookPropsMixin(props, *, strategy=None)
Bases:
MixinThe
AWS::AutoScaling::LifecycleHookresource specifies lifecycle hooks for an Auto Scaling group.These hooks let you create solutions that are aware of events in the Auto Scaling instance lifecycle, and then perform a custom action on instances when the corresponding lifecycle event occurs. A lifecycle hook provides a specified amount of time (one hour by default) to wait for the action to complete before the instance transitions to the next state.
Use lifecycle hooks to prepare new instances for use or to delay them from being registered behind a load balancer before their configuration has been applied completely. You can also use lifecycle hooks to prepare running instances to be terminated by, for example, downloading logs or other data.
For more information, see Amazon EC2 Auto Scaling lifecycle hooks in the Amazon EC2 Auto Scaling User Guide .
- See:
- CloudformationResource:
AWS::AutoScaling::LifecycleHook
- Mixin:
true
- 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.mixins_preview import mixins from aws_cdk.mixins_preview.aws_autoscaling import mixins as autoscaling_mixins cfn_lifecycle_hook_props_mixin = autoscaling_mixins.CfnLifecycleHookPropsMixin(autoscaling_mixins.CfnLifecycleHookMixinProps( auto_scaling_group_name="autoScalingGroupName", default_result="defaultResult", heartbeat_timeout=123, lifecycle_hook_name="lifecycleHookName", lifecycle_transition="lifecycleTransition", notification_metadata="notificationMetadata", notification_target_arn="notificationTargetArn", role_arn="roleArn" ), strategy=mixins.PropertyMergeStrategy.OVERRIDE )
Create a mixin to apply properties to
AWS::AutoScaling::LifecycleHook.- Parameters:
props (
Union[CfnLifecycleHookMixinProps,Dict[str,Any]]) – L1 properties to apply.strategy (
Optional[PropertyMergeStrategy]) – (experimental) Strategy for merging nested properties. Default: - PropertyMergeStrategy.MERGE
Methods
- apply_to(construct)
Apply the mixin properties to the construct.
- Parameters:
construct (
IConstruct)- Return type:
- supports(construct)
Check if this mixin supports the given construct.
- Parameters:
construct (
IConstruct)- Return type:
bool
Attributes
- CFN_PROPERTY_KEYS = ['autoScalingGroupName', 'defaultResult', 'heartbeatTimeout', 'lifecycleHookName', 'lifecycleTransition', 'notificationMetadata', 'notificationTargetArn', 'roleArn']
Static Methods
- classmethod is_mixin(x)
(experimental) Checks if
xis a Mixin.- Parameters:
x (
Any) – Any object.- Return type:
bool- Returns:
true if
xis an object created from a class which extendsMixin.- Stability:
experimental