/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#pragma once
#include Describes information used to specify a lifecycle hook for an Auto Scaling
* group. A lifecycle hook tells Amazon EC2 Auto Scaling to perform an
* action on an instance when the instance launches (before it is put into service)
* or as the instance terminates (before it is fully terminated). This step
* is a part of the procedure for creating a lifecycle hook for an Auto Scaling
* group: (Optional) Create a Lambda function and a rule that
* allows CloudWatch Events to invoke your Lambda function when Amazon EC2 Auto
* Scaling launches or terminates instances. (Optional) Create a
* notification target and an IAM role. The target can be either an Amazon SQS
* queue or an Amazon SNS topic. The role allows Amazon EC2 Auto Scaling to publish
* lifecycle notifications to the target. Create the
* lifecycle hook. Specify whether the hook is used when the instances launch or
* terminate. If you need more time, record the lifecycle
* action heartbeat to keep the instance in a pending state. If
* you finish before the timeout period ends, complete the lifecycle action. For more information, see Amazon
* EC2 Auto Scaling Lifecycle Hooks in the Amazon EC2 Auto Scaling User
* Guide.
See Also:
AWS
* API Reference
The name of the lifecycle hook.
*/ inline const Aws::String& GetLifecycleHookName() const{ return m_lifecycleHookName; } /** *The name of the lifecycle hook.
*/ inline bool LifecycleHookNameHasBeenSet() const { return m_lifecycleHookNameHasBeenSet; } /** *The name of the lifecycle hook.
*/ inline void SetLifecycleHookName(const Aws::String& value) { m_lifecycleHookNameHasBeenSet = true; m_lifecycleHookName = value; } /** *The name of the lifecycle hook.
*/ inline void SetLifecycleHookName(Aws::String&& value) { m_lifecycleHookNameHasBeenSet = true; m_lifecycleHookName = std::move(value); } /** *The name of the lifecycle hook.
*/ inline void SetLifecycleHookName(const char* value) { m_lifecycleHookNameHasBeenSet = true; m_lifecycleHookName.assign(value); } /** *The name of the lifecycle hook.
*/ inline LifecycleHookSpecification& WithLifecycleHookName(const Aws::String& value) { SetLifecycleHookName(value); return *this;} /** *The name of the lifecycle hook.
*/ inline LifecycleHookSpecification& WithLifecycleHookName(Aws::String&& value) { SetLifecycleHookName(std::move(value)); return *this;} /** *The name of the lifecycle hook.
*/ inline LifecycleHookSpecification& WithLifecycleHookName(const char* value) { SetLifecycleHookName(value); return *this;} /** *The state of the EC2 instance to which you want to attach the lifecycle hook. * The valid values are:
autoscaling:EC2_INSTANCE_LAUNCHING
*autoscaling:EC2_INSTANCE_TERMINATING
The state of the EC2 instance to which you want to attach the lifecycle hook. * The valid values are:
autoscaling:EC2_INSTANCE_LAUNCHING
*autoscaling:EC2_INSTANCE_TERMINATING
The state of the EC2 instance to which you want to attach the lifecycle hook. * The valid values are:
autoscaling:EC2_INSTANCE_LAUNCHING
*autoscaling:EC2_INSTANCE_TERMINATING
The state of the EC2 instance to which you want to attach the lifecycle hook. * The valid values are:
autoscaling:EC2_INSTANCE_LAUNCHING
*autoscaling:EC2_INSTANCE_TERMINATING
The state of the EC2 instance to which you want to attach the lifecycle hook. * The valid values are:
autoscaling:EC2_INSTANCE_LAUNCHING
*autoscaling:EC2_INSTANCE_TERMINATING
The state of the EC2 instance to which you want to attach the lifecycle hook. * The valid values are:
autoscaling:EC2_INSTANCE_LAUNCHING
*autoscaling:EC2_INSTANCE_TERMINATING
The state of the EC2 instance to which you want to attach the lifecycle hook. * The valid values are:
autoscaling:EC2_INSTANCE_LAUNCHING
*autoscaling:EC2_INSTANCE_TERMINATING
The state of the EC2 instance to which you want to attach the lifecycle hook. * The valid values are:
autoscaling:EC2_INSTANCE_LAUNCHING
*autoscaling:EC2_INSTANCE_TERMINATING
Additional information that you want to include any time Amazon EC2 Auto * Scaling sends a message to the notification target.
*/ inline const Aws::String& GetNotificationMetadata() const{ return m_notificationMetadata; } /** *Additional information that you want to include any time Amazon EC2 Auto * Scaling sends a message to the notification target.
*/ inline bool NotificationMetadataHasBeenSet() const { return m_notificationMetadataHasBeenSet; } /** *Additional information that you want to include any time Amazon EC2 Auto * Scaling sends a message to the notification target.
*/ inline void SetNotificationMetadata(const Aws::String& value) { m_notificationMetadataHasBeenSet = true; m_notificationMetadata = value; } /** *Additional information that you want to include any time Amazon EC2 Auto * Scaling sends a message to the notification target.
*/ inline void SetNotificationMetadata(Aws::String&& value) { m_notificationMetadataHasBeenSet = true; m_notificationMetadata = std::move(value); } /** *Additional information that you want to include any time Amazon EC2 Auto * Scaling sends a message to the notification target.
*/ inline void SetNotificationMetadata(const char* value) { m_notificationMetadataHasBeenSet = true; m_notificationMetadata.assign(value); } /** *Additional information that you want to include any time Amazon EC2 Auto * Scaling sends a message to the notification target.
*/ inline LifecycleHookSpecification& WithNotificationMetadata(const Aws::String& value) { SetNotificationMetadata(value); return *this;} /** *Additional information that you want to include any time Amazon EC2 Auto * Scaling sends a message to the notification target.
*/ inline LifecycleHookSpecification& WithNotificationMetadata(Aws::String&& value) { SetNotificationMetadata(std::move(value)); return *this;} /** *Additional information that you want to include any time Amazon EC2 Auto * Scaling sends a message to the notification target.
*/ inline LifecycleHookSpecification& WithNotificationMetadata(const char* value) { SetNotificationMetadata(value); return *this;} /** *The maximum time, in seconds, that can elapse before the lifecycle hook times * out.
If the lifecycle hook times out, Amazon EC2 Auto Scaling performs
* the action that you specified in the DefaultResult parameter. You
* can prevent the lifecycle hook from timing out by calling
* RecordLifecycleActionHeartbeat.
The maximum time, in seconds, that can elapse before the lifecycle hook times * out.
If the lifecycle hook times out, Amazon EC2 Auto Scaling performs
* the action that you specified in the DefaultResult parameter. You
* can prevent the lifecycle hook from timing out by calling
* RecordLifecycleActionHeartbeat.
The maximum time, in seconds, that can elapse before the lifecycle hook times * out.
If the lifecycle hook times out, Amazon EC2 Auto Scaling performs
* the action that you specified in the DefaultResult parameter. You
* can prevent the lifecycle hook from timing out by calling
* RecordLifecycleActionHeartbeat.
The maximum time, in seconds, that can elapse before the lifecycle hook times * out.
If the lifecycle hook times out, Amazon EC2 Auto Scaling performs
* the action that you specified in the DefaultResult parameter. You
* can prevent the lifecycle hook from timing out by calling
* RecordLifecycleActionHeartbeat.
Defines the action the Auto Scaling group should take when the lifecycle hook
* timeout elapses or if an unexpected failure occurs. The valid values are
* CONTINUE and ABANDON. The default value is
* ABANDON.
Defines the action the Auto Scaling group should take when the lifecycle hook
* timeout elapses or if an unexpected failure occurs. The valid values are
* CONTINUE and ABANDON. The default value is
* ABANDON.
Defines the action the Auto Scaling group should take when the lifecycle hook
* timeout elapses or if an unexpected failure occurs. The valid values are
* CONTINUE and ABANDON. The default value is
* ABANDON.
Defines the action the Auto Scaling group should take when the lifecycle hook
* timeout elapses or if an unexpected failure occurs. The valid values are
* CONTINUE and ABANDON. The default value is
* ABANDON.
Defines the action the Auto Scaling group should take when the lifecycle hook
* timeout elapses or if an unexpected failure occurs. The valid values are
* CONTINUE and ABANDON. The default value is
* ABANDON.
Defines the action the Auto Scaling group should take when the lifecycle hook
* timeout elapses or if an unexpected failure occurs. The valid values are
* CONTINUE and ABANDON. The default value is
* ABANDON.
Defines the action the Auto Scaling group should take when the lifecycle hook
* timeout elapses or if an unexpected failure occurs. The valid values are
* CONTINUE and ABANDON. The default value is
* ABANDON.
Defines the action the Auto Scaling group should take when the lifecycle hook
* timeout elapses or if an unexpected failure occurs. The valid values are
* CONTINUE and ABANDON. The default value is
* ABANDON.
The ARN of the target that Amazon EC2 Auto Scaling sends notifications to * when an instance is in the transition state for the lifecycle hook. The * notification target can be either an SQS queue or an SNS topic.
*/ inline const Aws::String& GetNotificationTargetARN() const{ return m_notificationTargetARN; } /** *The ARN of the target that Amazon EC2 Auto Scaling sends notifications to * when an instance is in the transition state for the lifecycle hook. The * notification target can be either an SQS queue or an SNS topic.
*/ inline bool NotificationTargetARNHasBeenSet() const { return m_notificationTargetARNHasBeenSet; } /** *The ARN of the target that Amazon EC2 Auto Scaling sends notifications to * when an instance is in the transition state for the lifecycle hook. The * notification target can be either an SQS queue or an SNS topic.
*/ inline void SetNotificationTargetARN(const Aws::String& value) { m_notificationTargetARNHasBeenSet = true; m_notificationTargetARN = value; } /** *The ARN of the target that Amazon EC2 Auto Scaling sends notifications to * when an instance is in the transition state for the lifecycle hook. The * notification target can be either an SQS queue or an SNS topic.
*/ inline void SetNotificationTargetARN(Aws::String&& value) { m_notificationTargetARNHasBeenSet = true; m_notificationTargetARN = std::move(value); } /** *The ARN of the target that Amazon EC2 Auto Scaling sends notifications to * when an instance is in the transition state for the lifecycle hook. The * notification target can be either an SQS queue or an SNS topic.
*/ inline void SetNotificationTargetARN(const char* value) { m_notificationTargetARNHasBeenSet = true; m_notificationTargetARN.assign(value); } /** *The ARN of the target that Amazon EC2 Auto Scaling sends notifications to * when an instance is in the transition state for the lifecycle hook. The * notification target can be either an SQS queue or an SNS topic.
*/ inline LifecycleHookSpecification& WithNotificationTargetARN(const Aws::String& value) { SetNotificationTargetARN(value); return *this;} /** *The ARN of the target that Amazon EC2 Auto Scaling sends notifications to * when an instance is in the transition state for the lifecycle hook. The * notification target can be either an SQS queue or an SNS topic.
*/ inline LifecycleHookSpecification& WithNotificationTargetARN(Aws::String&& value) { SetNotificationTargetARN(std::move(value)); return *this;} /** *The ARN of the target that Amazon EC2 Auto Scaling sends notifications to * when an instance is in the transition state for the lifecycle hook. The * notification target can be either an SQS queue or an SNS topic.
*/ inline LifecycleHookSpecification& WithNotificationTargetARN(const char* value) { SetNotificationTargetARN(value); return *this;} /** *The ARN of the IAM role that allows the Auto Scaling group to publish to the * specified notification target, for example, an Amazon SNS topic or an Amazon SQS * queue.
*/ inline const Aws::String& GetRoleARN() const{ return m_roleARN; } /** *The ARN of the IAM role that allows the Auto Scaling group to publish to the * specified notification target, for example, an Amazon SNS topic or an Amazon SQS * queue.
*/ inline bool RoleARNHasBeenSet() const { return m_roleARNHasBeenSet; } /** *The ARN of the IAM role that allows the Auto Scaling group to publish to the * specified notification target, for example, an Amazon SNS topic or an Amazon SQS * queue.
*/ inline void SetRoleARN(const Aws::String& value) { m_roleARNHasBeenSet = true; m_roleARN = value; } /** *The ARN of the IAM role that allows the Auto Scaling group to publish to the * specified notification target, for example, an Amazon SNS topic or an Amazon SQS * queue.
*/ inline void SetRoleARN(Aws::String&& value) { m_roleARNHasBeenSet = true; m_roleARN = std::move(value); } /** *The ARN of the IAM role that allows the Auto Scaling group to publish to the * specified notification target, for example, an Amazon SNS topic or an Amazon SQS * queue.
*/ inline void SetRoleARN(const char* value) { m_roleARNHasBeenSet = true; m_roleARN.assign(value); } /** *The ARN of the IAM role that allows the Auto Scaling group to publish to the * specified notification target, for example, an Amazon SNS topic or an Amazon SQS * queue.
*/ inline LifecycleHookSpecification& WithRoleARN(const Aws::String& value) { SetRoleARN(value); return *this;} /** *The ARN of the IAM role that allows the Auto Scaling group to publish to the * specified notification target, for example, an Amazon SNS topic or an Amazon SQS * queue.
*/ inline LifecycleHookSpecification& WithRoleARN(Aws::String&& value) { SetRoleARN(std::move(value)); return *this;} /** *The ARN of the IAM role that allows the Auto Scaling group to publish to the * specified notification target, for example, an Amazon SNS topic or an Amazon SQS * queue.
*/ inline LifecycleHookSpecification& WithRoleARN(const char* value) { SetRoleARN(value); return *this;} private: Aws::String m_lifecycleHookName; bool m_lifecycleHookNameHasBeenSet; Aws::String m_lifecycleTransition; bool m_lifecycleTransitionHasBeenSet; Aws::String m_notificationMetadata; bool m_notificationMetadataHasBeenSet; int m_heartbeatTimeout; bool m_heartbeatTimeoutHasBeenSet; Aws::String m_defaultResult; bool m_defaultResultHasBeenSet; Aws::String m_notificationTargetARN; bool m_notificationTargetARNHasBeenSet; Aws::String m_roleARN; bool m_roleARNHasBeenSet; }; } // namespace Model } // namespace AutoScaling } // namespace Aws