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

com.pulumi.awsnative.applicationautoscaling.kotlin.inputs.ScalingPolicyTargetTrackingScalingPolicyConfigurationArgs.kt Maven / Gradle / Ivy

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

package com.pulumi.awsnative.applicationautoscaling.kotlin.inputs

import com.pulumi.awsnative.applicationautoscaling.inputs.ScalingPolicyTargetTrackingScalingPolicyConfigurationArgs.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 com.pulumi.kotlin.applySuspend
import kotlin.Boolean
import kotlin.Double
import kotlin.Int
import kotlin.Suppress
import kotlin.Unit
import kotlin.jvm.JvmName

/**
 * ``TargetTrackingScalingPolicyConfiguration`` is a property of the [AWS::ApplicationAutoScaling::ScalingPolicy](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-applicationautoscaling-scalingpolicy.html) resource that specifies a target tracking scaling policy configuration for Application Auto Scaling. Use a target tracking scaling policy to adjust the capacity of the specified scalable target in response to actual workloads, so that resource utilization remains at or near the target utilization value.
 *  For more information, see [Target tracking scaling policies](https://docs.aws.amazon.com/autoscaling/application/userguide/application-auto-scaling-target-tracking.html) in the *Application Auto Scaling User Guide*.
 * @property customizedMetricSpecification A customized metric. You can specify either a predefined metric or a customized metric.
 * @property disableScaleIn Indicates whether scale in by the target tracking scaling policy is disabled. If the value is ``true``, scale in is disabled and the target tracking scaling policy won't remove capacity from the scalable target. Otherwise, scale in is enabled and the target tracking scaling policy can remove capacity from the scalable target. The default value is ``false``.
 * @property predefinedMetricSpecification A predefined metric. You can specify either a predefined metric or a customized metric.
 * @property scaleInCooldown The amount of time, in seconds, after a scale-in activity completes before another scale-in activity can start. For more information and for default values, see [Define cooldown periods](https://docs.aws.amazon.com/autoscaling/application/userguide/target-tracking-scaling-policy-overview.html#target-tracking-cooldown) in the *Application Auto Scaling User Guide*.
 * @property scaleOutCooldown The amount of time, in seconds, to wait for a previous scale-out activity to take effect. For more information and for default values, see [Define cooldown periods](https://docs.aws.amazon.com/autoscaling/application/userguide/target-tracking-scaling-policy-overview.html#target-tracking-cooldown) in the *Application Auto Scaling User Guide*.
 * @property targetValue The target value for the metric. Although this property accepts numbers of type Double, it won't accept values that are either too small or too large. Values must be in the range of -2^360 to 2^360. The value must be a valid number based on the choice of metric. For example, if the metric is CPU utilization, then the target value is a percent value that represents how much of the CPU can be used before scaling out.
 */
public data class ScalingPolicyTargetTrackingScalingPolicyConfigurationArgs(
    public val customizedMetricSpecification: Output? =
        null,
    public val disableScaleIn: Output? = null,
    public val predefinedMetricSpecification: Output? =
        null,
    public val scaleInCooldown: Output? = null,
    public val scaleOutCooldown: Output? = null,
    public val targetValue: Output,
) :
    ConvertibleToJava {
    override fun toJava(): com.pulumi.awsnative.applicationautoscaling.inputs.ScalingPolicyTargetTrackingScalingPolicyConfigurationArgs =
        com.pulumi.awsnative.applicationautoscaling.inputs.ScalingPolicyTargetTrackingScalingPolicyConfigurationArgs.builder()
            .customizedMetricSpecification(
                customizedMetricSpecification?.applyValue({ args0 ->
                    args0.let({ args0 -> args0.toJava() })
                }),
            )
            .disableScaleIn(disableScaleIn?.applyValue({ args0 -> args0 }))
            .predefinedMetricSpecification(
                predefinedMetricSpecification?.applyValue({ args0 ->
                    args0.let({ args0 -> args0.toJava() })
                }),
            )
            .scaleInCooldown(scaleInCooldown?.applyValue({ args0 -> args0 }))
            .scaleOutCooldown(scaleOutCooldown?.applyValue({ args0 -> args0 }))
            .targetValue(targetValue.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [ScalingPolicyTargetTrackingScalingPolicyConfigurationArgs].
 */
@PulumiTagMarker
public class ScalingPolicyTargetTrackingScalingPolicyConfigurationArgsBuilder internal constructor() {
    private var customizedMetricSpecification: Output? =
        null

    private var disableScaleIn: Output? = null

    private var predefinedMetricSpecification: Output? =
        null

    private var scaleInCooldown: Output? = null

    private var scaleOutCooldown: Output? = null

    private var targetValue: Output? = null

    /**
     * @param value A customized metric. You can specify either a predefined metric or a customized metric.
     */
    @JvmName("ttjnwnbmgeecdrae")
    public suspend fun customizedMetricSpecification(`value`: Output) {
        this.customizedMetricSpecification = value
    }

    /**
     * @param value Indicates whether scale in by the target tracking scaling policy is disabled. If the value is ``true``, scale in is disabled and the target tracking scaling policy won't remove capacity from the scalable target. Otherwise, scale in is enabled and the target tracking scaling policy can remove capacity from the scalable target. The default value is ``false``.
     */
    @JvmName("uappigtjxjmxiyol")
    public suspend fun disableScaleIn(`value`: Output) {
        this.disableScaleIn = value
    }

    /**
     * @param value A predefined metric. You can specify either a predefined metric or a customized metric.
     */
    @JvmName("oljbpoiepyvultrj")
    public suspend fun predefinedMetricSpecification(`value`: Output) {
        this.predefinedMetricSpecification = value
    }

    /**
     * @param value The amount of time, in seconds, after a scale-in activity completes before another scale-in activity can start. For more information and for default values, see [Define cooldown periods](https://docs.aws.amazon.com/autoscaling/application/userguide/target-tracking-scaling-policy-overview.html#target-tracking-cooldown) in the *Application Auto Scaling User Guide*.
     */
    @JvmName("adrwguxpwrxuoejl")
    public suspend fun scaleInCooldown(`value`: Output) {
        this.scaleInCooldown = value
    }

    /**
     * @param value The amount of time, in seconds, to wait for a previous scale-out activity to take effect. For more information and for default values, see [Define cooldown periods](https://docs.aws.amazon.com/autoscaling/application/userguide/target-tracking-scaling-policy-overview.html#target-tracking-cooldown) in the *Application Auto Scaling User Guide*.
     */
    @JvmName("mqohqrbdeqbyplox")
    public suspend fun scaleOutCooldown(`value`: Output) {
        this.scaleOutCooldown = value
    }

    /**
     * @param value The target value for the metric. Although this property accepts numbers of type Double, it won't accept values that are either too small or too large. Values must be in the range of -2^360 to 2^360. The value must be a valid number based on the choice of metric. For example, if the metric is CPU utilization, then the target value is a percent value that represents how much of the CPU can be used before scaling out.
     */
    @JvmName("ftjruiywvsemxknw")
    public suspend fun targetValue(`value`: Output) {
        this.targetValue = value
    }

    /**
     * @param value A customized metric. You can specify either a predefined metric or a customized metric.
     */
    @JvmName("ekgroarpyblabxsn")
    public suspend fun customizedMetricSpecification(`value`: ScalingPolicyCustomizedMetricSpecificationArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.customizedMetricSpecification = mapped
    }

    /**
     * @param argument A customized metric. You can specify either a predefined metric or a customized metric.
     */
    @JvmName("pxgtvmlottbqweyw")
    public suspend fun customizedMetricSpecification(argument: suspend ScalingPolicyCustomizedMetricSpecificationArgsBuilder.() -> Unit) {
        val toBeMapped = ScalingPolicyCustomizedMetricSpecificationArgsBuilder().applySuspend {
            argument()
        }.build()
        val mapped = of(toBeMapped)
        this.customizedMetricSpecification = mapped
    }

    /**
     * @param value Indicates whether scale in by the target tracking scaling policy is disabled. If the value is ``true``, scale in is disabled and the target tracking scaling policy won't remove capacity from the scalable target. Otherwise, scale in is enabled and the target tracking scaling policy can remove capacity from the scalable target. The default value is ``false``.
     */
    @JvmName("fpudytossbyeglte")
    public suspend fun disableScaleIn(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.disableScaleIn = mapped
    }

    /**
     * @param value A predefined metric. You can specify either a predefined metric or a customized metric.
     */
    @JvmName("tdbtbpnemdassrqn")
    public suspend fun predefinedMetricSpecification(`value`: ScalingPolicyPredefinedMetricSpecificationArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.predefinedMetricSpecification = mapped
    }

    /**
     * @param argument A predefined metric. You can specify either a predefined metric or a customized metric.
     */
    @JvmName("ymmtbgqfdqgmlflq")
    public suspend fun predefinedMetricSpecification(argument: suspend ScalingPolicyPredefinedMetricSpecificationArgsBuilder.() -> Unit) {
        val toBeMapped = ScalingPolicyPredefinedMetricSpecificationArgsBuilder().applySuspend {
            argument()
        }.build()
        val mapped = of(toBeMapped)
        this.predefinedMetricSpecification = mapped
    }

    /**
     * @param value The amount of time, in seconds, after a scale-in activity completes before another scale-in activity can start. For more information and for default values, see [Define cooldown periods](https://docs.aws.amazon.com/autoscaling/application/userguide/target-tracking-scaling-policy-overview.html#target-tracking-cooldown) in the *Application Auto Scaling User Guide*.
     */
    @JvmName("okscisnorjjtkuyi")
    public suspend fun scaleInCooldown(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.scaleInCooldown = mapped
    }

    /**
     * @param value The amount of time, in seconds, to wait for a previous scale-out activity to take effect. For more information and for default values, see [Define cooldown periods](https://docs.aws.amazon.com/autoscaling/application/userguide/target-tracking-scaling-policy-overview.html#target-tracking-cooldown) in the *Application Auto Scaling User Guide*.
     */
    @JvmName("lhvjuhyqdlfgpetr")
    public suspend fun scaleOutCooldown(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.scaleOutCooldown = mapped
    }

    /**
     * @param value The target value for the metric. Although this property accepts numbers of type Double, it won't accept values that are either too small or too large. Values must be in the range of -2^360 to 2^360. The value must be a valid number based on the choice of metric. For example, if the metric is CPU utilization, then the target value is a percent value that represents how much of the CPU can be used before scaling out.
     */
    @JvmName("vuadlbpnieuqonoh")
    public suspend fun targetValue(`value`: Double) {
        val toBeMapped = value
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.targetValue = mapped
    }

    internal fun build(): ScalingPolicyTargetTrackingScalingPolicyConfigurationArgs =
        ScalingPolicyTargetTrackingScalingPolicyConfigurationArgs(
            customizedMetricSpecification = customizedMetricSpecification,
            disableScaleIn = disableScaleIn,
            predefinedMetricSpecification = predefinedMetricSpecification,
            scaleInCooldown = scaleInCooldown,
            scaleOutCooldown = scaleOutCooldown,
            targetValue = targetValue ?: throw PulumiNullFieldException("targetValue"),
        )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy