aws_sdk_autoscaling/client/
put_lifecycle_hook.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2impl super::Client {
3    /// Constructs a fluent builder for the [`PutLifecycleHook`](crate::operation::put_lifecycle_hook::builders::PutLifecycleHookFluentBuilder) operation.
4    ///
5    /// - The fluent builder is configurable:
6    ///   - [`lifecycle_hook_name(impl Into<String>)`](crate::operation::put_lifecycle_hook::builders::PutLifecycleHookFluentBuilder::lifecycle_hook_name) / [`set_lifecycle_hook_name(Option<String>)`](crate::operation::put_lifecycle_hook::builders::PutLifecycleHookFluentBuilder::set_lifecycle_hook_name):<br>required: **true**<br><p>The name of the lifecycle hook.</p><br>
7    ///   - [`auto_scaling_group_name(impl Into<String>)`](crate::operation::put_lifecycle_hook::builders::PutLifecycleHookFluentBuilder::auto_scaling_group_name) / [`set_auto_scaling_group_name(Option<String>)`](crate::operation::put_lifecycle_hook::builders::PutLifecycleHookFluentBuilder::set_auto_scaling_group_name):<br>required: **true**<br><p>The name of the Auto Scaling group.</p><br>
8    ///   - [`lifecycle_transition(impl Into<String>)`](crate::operation::put_lifecycle_hook::builders::PutLifecycleHookFluentBuilder::lifecycle_transition) / [`set_lifecycle_transition(Option<String>)`](crate::operation::put_lifecycle_hook::builders::PutLifecycleHookFluentBuilder::set_lifecycle_transition):<br>required: **false**<br><p>The lifecycle transition. For Auto Scaling groups, there are two major lifecycle transitions.</p> <ul>  <li>   <p>To create a lifecycle hook for scale-out events, specify <code>autoscaling:EC2_INSTANCE_LAUNCHING</code>.</p></li>  <li>   <p>To create a lifecycle hook for scale-in events, specify <code>autoscaling:EC2_INSTANCE_TERMINATING</code>.</p></li> </ul> <p>Required for new lifecycle hooks, but optional when updating existing hooks.</p><br>
9    ///   - [`role_arn(impl Into<String>)`](crate::operation::put_lifecycle_hook::builders::PutLifecycleHookFluentBuilder::role_arn) / [`set_role_arn(Option<String>)`](crate::operation::put_lifecycle_hook::builders::PutLifecycleHookFluentBuilder::set_role_arn):<br>required: **false**<br><p>The ARN of the IAM role that allows the Auto Scaling group to publish to the specified notification target.</p> <p>Valid only if the notification target is an Amazon SNS topic or an Amazon SQS queue. Required for new lifecycle hooks, but optional when updating existing hooks.</p><br>
10    ///   - [`notification_target_arn(impl Into<String>)`](crate::operation::put_lifecycle_hook::builders::PutLifecycleHookFluentBuilder::notification_target_arn) / [`set_notification_target_arn(Option<String>)`](crate::operation::put_lifecycle_hook::builders::PutLifecycleHookFluentBuilder::set_notification_target_arn):<br>required: **false**<br><p>The Amazon Resource Name (ARN) of the notification target that Amazon EC2 Auto Scaling uses to notify you when an instance is in a wait state for the lifecycle hook. You can specify either an Amazon SNS topic or an Amazon SQS queue.</p> <p>If you specify an empty string, this overrides the current ARN.</p> <p>This operation uses the JSON format when sending notifications to an Amazon SQS queue, and an email key-value pair format when sending notifications to an Amazon SNS topic.</p> <p>When you specify a notification target, Amazon EC2 Auto Scaling sends it a test message. Test messages contain the following additional key-value pair: <code>"Event": "autoscaling:TEST_NOTIFICATION"</code>.</p><br>
11    ///   - [`notification_metadata(impl Into<String>)`](crate::operation::put_lifecycle_hook::builders::PutLifecycleHookFluentBuilder::notification_metadata) / [`set_notification_metadata(Option<String>)`](crate::operation::put_lifecycle_hook::builders::PutLifecycleHookFluentBuilder::set_notification_metadata):<br>required: **false**<br><p>Additional information that you want to include any time Amazon EC2 Auto Scaling sends a message to the notification target.</p><br>
12    ///   - [`heartbeat_timeout(i32)`](crate::operation::put_lifecycle_hook::builders::PutLifecycleHookFluentBuilder::heartbeat_timeout) / [`set_heartbeat_timeout(Option<i32>)`](crate::operation::put_lifecycle_hook::builders::PutLifecycleHookFluentBuilder::set_heartbeat_timeout):<br>required: **false**<br><p>The maximum time, in seconds, that can elapse before the lifecycle hook times out. The range is from <code>30</code> to <code>7200</code> seconds. The default value is <code>3600</code> seconds (1 hour).</p><br>
13    ///   - [`default_result(impl Into<String>)`](crate::operation::put_lifecycle_hook::builders::PutLifecycleHookFluentBuilder::default_result) / [`set_default_result(Option<String>)`](crate::operation::put_lifecycle_hook::builders::PutLifecycleHookFluentBuilder::set_default_result):<br>required: **false**<br><p>The action the Auto Scaling group takes when the lifecycle hook timeout elapses or if an unexpected failure occurs. The default value is <code>ABANDON</code>.</p> <p>Valid values: <code>CONTINUE</code> | <code>ABANDON</code></p><br>
14    /// - On success, responds with [`PutLifecycleHookOutput`](crate::operation::put_lifecycle_hook::PutLifecycleHookOutput)
15    /// - On failure, responds with [`SdkError<PutLifecycleHookError>`](crate::operation::put_lifecycle_hook::PutLifecycleHookError)
16    pub fn put_lifecycle_hook(&self) -> crate::operation::put_lifecycle_hook::builders::PutLifecycleHookFluentBuilder {
17        crate::operation::put_lifecycle_hook::builders::PutLifecycleHookFluentBuilder::new(self.handle.clone())
18    }
19}