All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.awsnative.autoscaling.kotlin.WarmPoolArgs.kt Maven / Gradle / Ivy

@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.awsnative.autoscaling.kotlin

import com.pulumi.awsnative.autoscaling.WarmPoolArgs.builder
import com.pulumi.awsnative.autoscaling.kotlin.inputs.WarmPoolInstanceReusePolicyArgs
import com.pulumi.awsnative.autoscaling.kotlin.inputs.WarmPoolInstanceReusePolicyArgsBuilder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.Int
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.jvm.JvmName

/**
 * Resource schema for AWS::AutoScaling::WarmPool.
 * @property autoScalingGroupName The name of the Auto Scaling group.
 * @property instanceReusePolicy Indicates whether instances in the Auto Scaling group can be returned to the warm pool on scale in. The default is to terminate instances in the Auto Scaling group when the group scales in.
 * @property maxGroupPreparedCapacity Specifies the maximum number of instances that are allowed to be in the warm pool or in any state except `Terminated` for the Auto Scaling group. This is an optional property. Specify it only if you do not want the warm pool size to be determined by the difference between the group's maximum capacity and its desired capacity.
 * > If a value for `MaxGroupPreparedCapacity` is not specified, Amazon EC2 Auto Scaling launches and maintains the difference between the group's maximum capacity and its desired capacity. If you specify a value for `MaxGroupPreparedCapacity` , Amazon EC2 Auto Scaling uses the difference between the `MaxGroupPreparedCapacity` and the desired capacity instead.
 * >
 * > The size of the warm pool is dynamic. Only when `MaxGroupPreparedCapacity` and `MinSize` are set to the same value does the warm pool have an absolute size.
 * If the desired capacity of the Auto Scaling group is higher than the `MaxGroupPreparedCapacity` , the capacity of the warm pool is 0, unless you specify a value for `MinSize` . To remove a value that you previously set, include the property but specify -1 for the value.
 * @property minSize Specifies the minimum number of instances to maintain in the warm pool. This helps you to ensure that there is always a certain number of warmed instances available to handle traffic spikes. Defaults to 0 if not specified.
 * @property poolState Sets the instance state to transition to after the lifecycle actions are complete. Default is `Stopped` .
 */
public data class WarmPoolArgs(
    public val autoScalingGroupName: Output? = null,
    public val instanceReusePolicy: Output? = null,
    public val maxGroupPreparedCapacity: Output? = null,
    public val minSize: Output? = null,
    public val poolState: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.awsnative.autoscaling.WarmPoolArgs =
        com.pulumi.awsnative.autoscaling.WarmPoolArgs.builder()
            .autoScalingGroupName(autoScalingGroupName?.applyValue({ args0 -> args0 }))
            .instanceReusePolicy(
                instanceReusePolicy?.applyValue({ args0 ->
                    args0.let({ args0 ->
                        args0.toJava()
                    })
                }),
            )
            .maxGroupPreparedCapacity(maxGroupPreparedCapacity?.applyValue({ args0 -> args0 }))
            .minSize(minSize?.applyValue({ args0 -> args0 }))
            .poolState(poolState?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [WarmPoolArgs].
 */
@PulumiTagMarker
public class WarmPoolArgsBuilder internal constructor() {
    private var autoScalingGroupName: Output? = null

    private var instanceReusePolicy: Output? = null

    private var maxGroupPreparedCapacity: Output? = null

    private var minSize: Output? = null

    private var poolState: Output? = null

    /**
     * @param value The name of the Auto Scaling group.
     */
    @JvmName("tbuwkkrjbxqngmwn")
    public suspend fun autoScalingGroupName(`value`: Output) {
        this.autoScalingGroupName = value
    }

    /**
     * @param value Indicates whether instances in the Auto Scaling group can be returned to the warm pool on scale in. The default is to terminate instances in the Auto Scaling group when the group scales in.
     */
    @JvmName("hcfndjwfikkwlvfn")
    public suspend fun instanceReusePolicy(`value`: Output) {
        this.instanceReusePolicy = value
    }

    /**
     * @param value Specifies the maximum number of instances that are allowed to be in the warm pool or in any state except `Terminated` for the Auto Scaling group. This is an optional property. Specify it only if you do not want the warm pool size to be determined by the difference between the group's maximum capacity and its desired capacity.
     * > If a value for `MaxGroupPreparedCapacity` is not specified, Amazon EC2 Auto Scaling launches and maintains the difference between the group's maximum capacity and its desired capacity. If you specify a value for `MaxGroupPreparedCapacity` , Amazon EC2 Auto Scaling uses the difference between the `MaxGroupPreparedCapacity` and the desired capacity instead.
     * >
     * > The size of the warm pool is dynamic. Only when `MaxGroupPreparedCapacity` and `MinSize` are set to the same value does the warm pool have an absolute size.
     * If the desired capacity of the Auto Scaling group is higher than the `MaxGroupPreparedCapacity` , the capacity of the warm pool is 0, unless you specify a value for `MinSize` . To remove a value that you previously set, include the property but specify -1 for the value.
     */
    @JvmName("quuxoqlrfqccktyo")
    public suspend fun maxGroupPreparedCapacity(`value`: Output) {
        this.maxGroupPreparedCapacity = value
    }

    /**
     * @param value Specifies the minimum number of instances to maintain in the warm pool. This helps you to ensure that there is always a certain number of warmed instances available to handle traffic spikes. Defaults to 0 if not specified.
     */
    @JvmName("bbjinxgsxyymstrw")
    public suspend fun minSize(`value`: Output) {
        this.minSize = value
    }

    /**
     * @param value Sets the instance state to transition to after the lifecycle actions are complete. Default is `Stopped` .
     */
    @JvmName("ccqfchjvywgymaax")
    public suspend fun poolState(`value`: Output) {
        this.poolState = value
    }

    /**
     * @param value The name of the Auto Scaling group.
     */
    @JvmName("evousixhjktyovva")
    public suspend fun autoScalingGroupName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.autoScalingGroupName = mapped
    }

    /**
     * @param value Indicates whether instances in the Auto Scaling group can be returned to the warm pool on scale in. The default is to terminate instances in the Auto Scaling group when the group scales in.
     */
    @JvmName("wiojxhvttkgqdrrw")
    public suspend fun instanceReusePolicy(`value`: WarmPoolInstanceReusePolicyArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.instanceReusePolicy = mapped
    }

    /**
     * @param argument Indicates whether instances in the Auto Scaling group can be returned to the warm pool on scale in. The default is to terminate instances in the Auto Scaling group when the group scales in.
     */
    @JvmName("sdhvydgkarguotqt")
    public suspend fun instanceReusePolicy(argument: suspend WarmPoolInstanceReusePolicyArgsBuilder.() -> Unit) {
        val toBeMapped = WarmPoolInstanceReusePolicyArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.instanceReusePolicy = mapped
    }

    /**
     * @param value Specifies the maximum number of instances that are allowed to be in the warm pool or in any state except `Terminated` for the Auto Scaling group. This is an optional property. Specify it only if you do not want the warm pool size to be determined by the difference between the group's maximum capacity and its desired capacity.
     * > If a value for `MaxGroupPreparedCapacity` is not specified, Amazon EC2 Auto Scaling launches and maintains the difference between the group's maximum capacity and its desired capacity. If you specify a value for `MaxGroupPreparedCapacity` , Amazon EC2 Auto Scaling uses the difference between the `MaxGroupPreparedCapacity` and the desired capacity instead.
     * >
     * > The size of the warm pool is dynamic. Only when `MaxGroupPreparedCapacity` and `MinSize` are set to the same value does the warm pool have an absolute size.
     * If the desired capacity of the Auto Scaling group is higher than the `MaxGroupPreparedCapacity` , the capacity of the warm pool is 0, unless you specify a value for `MinSize` . To remove a value that you previously set, include the property but specify -1 for the value.
     */
    @JvmName("egriknsakjsaikpk")
    public suspend fun maxGroupPreparedCapacity(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.maxGroupPreparedCapacity = mapped
    }

    /**
     * @param value Specifies the minimum number of instances to maintain in the warm pool. This helps you to ensure that there is always a certain number of warmed instances available to handle traffic spikes. Defaults to 0 if not specified.
     */
    @JvmName("omgpmkoysfyerxen")
    public suspend fun minSize(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.minSize = mapped
    }

    /**
     * @param value Sets the instance state to transition to after the lifecycle actions are complete. Default is `Stopped` .
     */
    @JvmName("ukuiroxieyqsqtog")
    public suspend fun poolState(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.poolState = mapped
    }

    internal fun build(): WarmPoolArgs = WarmPoolArgs(
        autoScalingGroupName = autoScalingGroupName,
        instanceReusePolicy = instanceReusePolicy,
        maxGroupPreparedCapacity = maxGroupPreparedCapacity,
        minSize = minSize,
        poolState = poolState,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy