![JAR search and dependency download from the Maven repository](/logo.png)
com.pulumi.awsnative.autoscaling.kotlin.LifecycleHook.kt Maven / Gradle / Ivy
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.awsnative.autoscaling.kotlin
import com.pulumi.core.Output
import com.pulumi.kotlin.KotlinCustomResource
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.ResourceMapper
import com.pulumi.kotlin.options.CustomResourceOptions
import com.pulumi.kotlin.options.CustomResourceOptionsBuilder
import com.pulumi.resources.Resource
import kotlin.Boolean
import kotlin.Int
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
/**
* Builder for [LifecycleHook].
*/
@PulumiTagMarker
public class LifecycleHookResourceBuilder internal constructor() {
public var name: String? = null
public var args: LifecycleHookArgs = LifecycleHookArgs()
public var opts: CustomResourceOptions = CustomResourceOptions()
/**
* @param name The _unique_ name of the resulting resource.
*/
public fun name(`value`: String) {
this.name = value
}
/**
* @param block The arguments to use to populate this resource's properties.
*/
public suspend fun args(block: suspend LifecycleHookArgsBuilder.() -> Unit) {
val builder = LifecycleHookArgsBuilder()
block(builder)
this.args = builder.build()
}
/**
* @param block A bag of options that control this resource's behavior.
*/
public suspend fun opts(block: suspend CustomResourceOptionsBuilder.() -> Unit) {
this.opts = com.pulumi.kotlin.options.CustomResourceOptions.opts(block)
}
internal fun build(): LifecycleHook {
val builtJavaResource = com.pulumi.awsnative.autoscaling.LifecycleHook(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return LifecycleHook(builtJavaResource)
}
}
/**
* Resource Type definition for AWS::AutoScaling::LifecycleHook
*/
public class LifecycleHook internal constructor(
override val javaResource: com.pulumi.awsnative.autoscaling.LifecycleHook,
) : KotlinCustomResource(javaResource, LifecycleHookMapper) {
/**
* The name of the Auto Scaling group for the lifecycle hook.
*/
public val autoScalingGroupName: Output
get() = javaResource.autoScalingGroupName().applyValue({ args0 -> args0 })
/**
* The action the Auto Scaling group takes when the lifecycle hook timeout elapses or if an unexpected failure occurs. The valid values are CONTINUE and ABANDON (default).
*/
public val defaultResult: Output?
get() = javaResource.defaultResult().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* 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). If the lifecycle hook times out, Amazon EC2 Auto Scaling performs the action that you specified in the DefaultResult property.
*/
public val heartbeatTimeout: Output?
get() = javaResource.heartbeatTimeout().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* The name of the lifecycle hook.
*/
public val lifecycleHookName: Output?
get() = javaResource.lifecycleHookName().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* The instance state to which you want to attach the lifecycle hook.
*/
public val lifecycleTransition: Output
get() = javaResource.lifecycleTransition().applyValue({ args0 -> args0 })
/**
* Additional information that is included any time Amazon EC2 Auto Scaling sends a message to the notification target.
*/
public val notificationMetadata: Output?
get() = javaResource.notificationMetadata().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* The Amazon Resource Name (ARN) of the notification target that Amazon EC2 Auto Scaling uses to notify you when an instance is in the transition state for the lifecycle hook. You can specify an Amazon SQS queue or an Amazon SNS topic. The notification message includes the following information: lifecycle action token, user account ID, Auto Scaling group name, lifecycle hook name, instance ID, lifecycle transition, and notification metadata.
*/
public val notificationTargetArn: Output?
get() = javaResource.notificationTargetArn().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* 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.
*/
public val roleArn: Output?
get() = javaResource.roleArn().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })
}
public object LifecycleHookMapper : ResourceMapper {
override fun supportsMappingOfType(javaResource: Resource): Boolean =
com.pulumi.awsnative.autoscaling.LifecycleHook::class == javaResource::class
override fun map(javaResource: Resource): LifecycleHook = LifecycleHook(
javaResource as
com.pulumi.awsnative.autoscaling.LifecycleHook,
)
}
/**
* @see [LifecycleHook].
* @param name The _unique_ name of the resulting resource.
* @param block Builder for [LifecycleHook].
*/
public suspend fun lifecycleHook(
name: String,
block: suspend LifecycleHookResourceBuilder.() -> Unit,
): LifecycleHook {
val builder = LifecycleHookResourceBuilder()
builder.name(name)
block(builder)
return builder.build()
}
/**
* @see [LifecycleHook].
* @param name The _unique_ name of the resulting resource.
*/
public fun lifecycleHook(name: String): LifecycleHook {
val builder = LifecycleHookResourceBuilder()
builder.name(name)
return builder.build()
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy