
com.pulumi.awsnative.autoscaling.kotlin.inputs.AutoScalingGroupLifecycleHookSpecificationArgs.kt Maven / Gradle / Ivy
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.awsnative.autoscaling.kotlin.inputs
import com.pulumi.awsnative.autoscaling.inputs.AutoScalingGroupLifecycleHookSpecificationArgs.builder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiNullFieldException
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.Int
import kotlin.String
import kotlin.Suppress
import kotlin.jvm.JvmName
/**
* ``LifecycleHookSpecification`` specifies a lifecycle hook for the ``LifecycleHookSpecificationList`` property of the [AWS::AutoScaling::AutoScalingGroup](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-autoscaling-autoscalinggroup.html) resource. A lifecycle hook specifies actions to perform when Amazon EC2 Auto Scaling launches or terminates instances.
* For more information, see [Amazon EC2 Auto Scaling lifecycle hooks](https://docs.aws.amazon.com/autoscaling/ec2/userguide/lifecycle-hooks.html) in the *Amazon EC2 Auto Scaling User Guide*. You can find a sample template snippet in the [Examples](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-as-lifecyclehook.html#aws-resource-as-lifecyclehook--examples) section of the ``AWS::AutoScaling::LifecycleHook`` resource.
* @property defaultResult The action the Auto Scaling group takes when the lifecycle hook timeout elapses or if an unexpected failure occurs. The default value is ``ABANDON``.
* Valid values: ``CONTINUE`` | ``ABANDON``
* @property heartbeatTimeout The maximum time, in seconds, that can elapse before the lifecycle hook times out. The range is from ``30`` to ``7200`` seconds. The default value is ``3600`` seconds (1 hour).
* @property lifecycleHookName The name of the lifecycle hook.
* @property lifecycleTransition The lifecycle transition. For Auto Scaling groups, there are two major lifecycle transitions.
* + To create a lifecycle hook for scale-out events, specify ``autoscaling:EC2_INSTANCE_LAUNCHING``.
* + To create a lifecycle hook for scale-in events, specify ``autoscaling:EC2_INSTANCE_TERMINATING``.
* @property notificationMetadata Additional information that you want to include any time Amazon EC2 Auto Scaling sends a message to the notification target.
* @property notificationTargetArn The Amazon Resource Name (ARN) of the notification target that Amazon EC2 Auto Scaling sends notifications to when an instance is in a wait state for the lifecycle hook. You can specify an Amazon SNS topic or an Amazon SQS queue.
* @property roleArn The ARN of the IAM role that allows the Auto Scaling group to publish to the specified notification target. For information about creating this role, see [Prepare to add a lifecycle hook to your Auto Scaling group](https://docs.aws.amazon.com/autoscaling/ec2/userguide/prepare-for-lifecycle-notifications.html) in the *Amazon EC2 Auto Scaling User Guide*.
* Valid only if the notification target is an Amazon SNS topic or an Amazon SQS queue.
*/
public data class AutoScalingGroupLifecycleHookSpecificationArgs(
public val defaultResult: Output? = null,
public val heartbeatTimeout: Output? = null,
public val lifecycleHookName: Output,
public val lifecycleTransition: Output,
public val notificationMetadata: Output? = null,
public val notificationTargetArn: Output? = null,
public val roleArn: Output? = null,
) :
ConvertibleToJava {
override fun toJava(): com.pulumi.awsnative.autoscaling.inputs.AutoScalingGroupLifecycleHookSpecificationArgs =
com.pulumi.awsnative.autoscaling.inputs.AutoScalingGroupLifecycleHookSpecificationArgs.builder()
.defaultResult(defaultResult?.applyValue({ args0 -> args0 }))
.heartbeatTimeout(heartbeatTimeout?.applyValue({ args0 -> args0 }))
.lifecycleHookName(lifecycleHookName.applyValue({ args0 -> args0 }))
.lifecycleTransition(lifecycleTransition.applyValue({ args0 -> args0 }))
.notificationMetadata(notificationMetadata?.applyValue({ args0 -> args0 }))
.notificationTargetArn(notificationTargetArn?.applyValue({ args0 -> args0 }))
.roleArn(roleArn?.applyValue({ args0 -> args0 })).build()
}
/**
* Builder for [AutoScalingGroupLifecycleHookSpecificationArgs].
*/
@PulumiTagMarker
public class AutoScalingGroupLifecycleHookSpecificationArgsBuilder internal constructor() {
private var defaultResult: Output? = null
private var heartbeatTimeout: Output? = null
private var lifecycleHookName: Output? = null
private var lifecycleTransition: Output? = null
private var notificationMetadata: Output? = null
private var notificationTargetArn: Output? = null
private var roleArn: Output? = null
/**
* @param value The action the Auto Scaling group takes when the lifecycle hook timeout elapses or if an unexpected failure occurs. The default value is ``ABANDON``.
* Valid values: ``CONTINUE`` | ``ABANDON``
*/
@JvmName("jrrakarvxrkembrp")
public suspend fun defaultResult(`value`: Output) {
this.defaultResult = value
}
/**
* @param value The maximum time, in seconds, that can elapse before the lifecycle hook times out. The range is from ``30`` to ``7200`` seconds. The default value is ``3600`` seconds (1 hour).
*/
@JvmName("cnfwyhvdavolfelt")
public suspend fun heartbeatTimeout(`value`: Output) {
this.heartbeatTimeout = value
}
/**
* @param value The name of the lifecycle hook.
*/
@JvmName("itlmlbcpryjhyvce")
public suspend fun lifecycleHookName(`value`: Output) {
this.lifecycleHookName = value
}
/**
* @param value The lifecycle transition. For Auto Scaling groups, there are two major lifecycle transitions.
* + To create a lifecycle hook for scale-out events, specify ``autoscaling:EC2_INSTANCE_LAUNCHING``.
* + To create a lifecycle hook for scale-in events, specify ``autoscaling:EC2_INSTANCE_TERMINATING``.
*/
@JvmName("phwqdcanncnssaxm")
public suspend fun lifecycleTransition(`value`: Output) {
this.lifecycleTransition = value
}
/**
* @param value Additional information that you want to include any time Amazon EC2 Auto Scaling sends a message to the notification target.
*/
@JvmName("dxurjgjjsyrvrqtq")
public suspend fun notificationMetadata(`value`: Output) {
this.notificationMetadata = value
}
/**
* @param value The Amazon Resource Name (ARN) of the notification target that Amazon EC2 Auto Scaling sends notifications to when an instance is in a wait state for the lifecycle hook. You can specify an Amazon SNS topic or an Amazon SQS queue.
*/
@JvmName("nglsbaolgfddrwut")
public suspend fun notificationTargetArn(`value`: Output) {
this.notificationTargetArn = value
}
/**
* @param value The ARN of the IAM role that allows the Auto Scaling group to publish to the specified notification target. For information about creating this role, see [Prepare to add a lifecycle hook to your Auto Scaling group](https://docs.aws.amazon.com/autoscaling/ec2/userguide/prepare-for-lifecycle-notifications.html) in the *Amazon EC2 Auto Scaling User Guide*.
* Valid only if the notification target is an Amazon SNS topic or an Amazon SQS queue.
*/
@JvmName("dgfigkakfxprlqvv")
public suspend fun roleArn(`value`: Output) {
this.roleArn = value
}
/**
* @param value The action the Auto Scaling group takes when the lifecycle hook timeout elapses or if an unexpected failure occurs. The default value is ``ABANDON``.
* Valid values: ``CONTINUE`` | ``ABANDON``
*/
@JvmName("nkyrjyfjrwrboqfs")
public suspend fun defaultResult(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.defaultResult = mapped
}
/**
* @param value The maximum time, in seconds, that can elapse before the lifecycle hook times out. The range is from ``30`` to ``7200`` seconds. The default value is ``3600`` seconds (1 hour).
*/
@JvmName("xbhwkxqmgpxxowcn")
public suspend fun heartbeatTimeout(`value`: Int?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.heartbeatTimeout = mapped
}
/**
* @param value The name of the lifecycle hook.
*/
@JvmName("krjycdsbdpbxfokf")
public suspend fun lifecycleHookName(`value`: String) {
val toBeMapped = value
val mapped = toBeMapped.let({ args0 -> of(args0) })
this.lifecycleHookName = mapped
}
/**
* @param value The lifecycle transition. For Auto Scaling groups, there are two major lifecycle transitions.
* + To create a lifecycle hook for scale-out events, specify ``autoscaling:EC2_INSTANCE_LAUNCHING``.
* + To create a lifecycle hook for scale-in events, specify ``autoscaling:EC2_INSTANCE_TERMINATING``.
*/
@JvmName("lnauclfqbucnwgaq")
public suspend fun lifecycleTransition(`value`: String) {
val toBeMapped = value
val mapped = toBeMapped.let({ args0 -> of(args0) })
this.lifecycleTransition = mapped
}
/**
* @param value Additional information that you want to include any time Amazon EC2 Auto Scaling sends a message to the notification target.
*/
@JvmName("bubbnaseuglmbdet")
public suspend fun notificationMetadata(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.notificationMetadata = mapped
}
/**
* @param value The Amazon Resource Name (ARN) of the notification target that Amazon EC2 Auto Scaling sends notifications to when an instance is in a wait state for the lifecycle hook. You can specify an Amazon SNS topic or an Amazon SQS queue.
*/
@JvmName("hwibwcdkephrqyte")
public suspend fun notificationTargetArn(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.notificationTargetArn = mapped
}
/**
* @param value The ARN of the IAM role that allows the Auto Scaling group to publish to the specified notification target. For information about creating this role, see [Prepare to add a lifecycle hook to your Auto Scaling group](https://docs.aws.amazon.com/autoscaling/ec2/userguide/prepare-for-lifecycle-notifications.html) in the *Amazon EC2 Auto Scaling User Guide*.
* Valid only if the notification target is an Amazon SNS topic or an Amazon SQS queue.
*/
@JvmName("bhpgtxmwhefsikfi")
public suspend fun roleArn(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.roleArn = mapped
}
internal fun build(): AutoScalingGroupLifecycleHookSpecificationArgs =
AutoScalingGroupLifecycleHookSpecificationArgs(
defaultResult = defaultResult,
heartbeatTimeout = heartbeatTimeout,
lifecycleHookName = lifecycleHookName ?: throw PulumiNullFieldException("lifecycleHookName"),
lifecycleTransition = lifecycleTransition ?: throw PulumiNullFieldException("lifecycleTransition"),
notificationMetadata = notificationMetadata,
notificationTargetArn = notificationTargetArn,
roleArn = roleArn,
)
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy