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

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

Go to download

Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.

There is a newer version: 0.122.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

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

import com.pulumi.awsnative.applicationautoscaling.inputs.ScalingPolicyStepScalingPolicyConfigurationArgs.builder
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.collections.List
import kotlin.jvm.JvmName

/**
 * ``StepScalingPolicyConfiguration`` 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 step scaling policy configuration for Application Auto Scaling.
 *  For more information, see [Step scaling policies](https://docs.aws.amazon.com/autoscaling/application/userguide/application-auto-scaling-step-scaling-policies.html) in the *Application Auto Scaling User Guide*.
 * @property adjustmentType Specifies whether the ``ScalingAdjustment`` value in the ``StepAdjustment`` property is an absolute number or a percentage of the current capacity.
 * @property cooldown The amount of time, in seconds, to wait for a previous scaling activity to take effect. If not specified, the default value is 300. For more information, see [Cooldown period](https://docs.aws.amazon.com/autoscaling/application/userguide/step-scaling-policy-overview.html#step-scaling-cooldown) in the *Application Auto Scaling User Guide*.
 * @property metricAggregationType The aggregation type for the CloudWatch metrics. Valid values are ``Minimum``, ``Maximum``, and ``Average``. If the aggregation type is null, the value is treated as ``Average``.
 * @property minAdjustmentMagnitude The minimum value to scale by when the adjustment type is ``PercentChangeInCapacity``. For example, suppose that you create a step scaling policy to scale out an Amazon ECS service by 25 percent and you specify a ``MinAdjustmentMagnitude`` of 2. If the service has 4 tasks and the scaling policy is performed, 25 percent of 4 is 1. However, because you specified a ``MinAdjustmentMagnitude`` of 2, Application Auto Scaling scales out the service by 2 tasks.
 * @property stepAdjustments A set of adjustments that enable you to scale based on the size of the alarm breach.
 *  At least one step adjustment is required if you are adding a new step scaling policy configuration.
 */
public data class ScalingPolicyStepScalingPolicyConfigurationArgs(
    public val adjustmentType: Output? = null,
    public val cooldown: Output? = null,
    public val metricAggregationType: Output? = null,
    public val minAdjustmentMagnitude: Output? = null,
    public val stepAdjustments: Output>? = null,
) :
    ConvertibleToJava {
    override fun toJava(): com.pulumi.awsnative.applicationautoscaling.inputs.ScalingPolicyStepScalingPolicyConfigurationArgs =
        com.pulumi.awsnative.applicationautoscaling.inputs.ScalingPolicyStepScalingPolicyConfigurationArgs.builder()
            .adjustmentType(adjustmentType?.applyValue({ args0 -> args0 }))
            .cooldown(cooldown?.applyValue({ args0 -> args0 }))
            .metricAggregationType(metricAggregationType?.applyValue({ args0 -> args0 }))
            .minAdjustmentMagnitude(minAdjustmentMagnitude?.applyValue({ args0 -> args0 }))
            .stepAdjustments(
                stepAdjustments?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            ).build()
}

/**
 * Builder for [ScalingPolicyStepScalingPolicyConfigurationArgs].
 */
@PulumiTagMarker
public class ScalingPolicyStepScalingPolicyConfigurationArgsBuilder internal constructor() {
    private var adjustmentType: Output? = null

    private var cooldown: Output? = null

    private var metricAggregationType: Output? = null

    private var minAdjustmentMagnitude: Output? = null

    private var stepAdjustments: Output>? = null

    /**
     * @param value Specifies whether the ``ScalingAdjustment`` value in the ``StepAdjustment`` property is an absolute number or a percentage of the current capacity.
     */
    @JvmName("fvijenvlqkurcwbt")
    public suspend fun adjustmentType(`value`: Output) {
        this.adjustmentType = value
    }

    /**
     * @param value The amount of time, in seconds, to wait for a previous scaling activity to take effect. If not specified, the default value is 300. For more information, see [Cooldown period](https://docs.aws.amazon.com/autoscaling/application/userguide/step-scaling-policy-overview.html#step-scaling-cooldown) in the *Application Auto Scaling User Guide*.
     */
    @JvmName("cpwhemsquqsisyxm")
    public suspend fun cooldown(`value`: Output) {
        this.cooldown = value
    }

    /**
     * @param value The aggregation type for the CloudWatch metrics. Valid values are ``Minimum``, ``Maximum``, and ``Average``. If the aggregation type is null, the value is treated as ``Average``.
     */
    @JvmName("ojhpoykgtmvrgnue")
    public suspend fun metricAggregationType(`value`: Output) {
        this.metricAggregationType = value
    }

    /**
     * @param value The minimum value to scale by when the adjustment type is ``PercentChangeInCapacity``. For example, suppose that you create a step scaling policy to scale out an Amazon ECS service by 25 percent and you specify a ``MinAdjustmentMagnitude`` of 2. If the service has 4 tasks and the scaling policy is performed, 25 percent of 4 is 1. However, because you specified a ``MinAdjustmentMagnitude`` of 2, Application Auto Scaling scales out the service by 2 tasks.
     */
    @JvmName("hasdhdjawatxfsgd")
    public suspend fun minAdjustmentMagnitude(`value`: Output) {
        this.minAdjustmentMagnitude = value
    }

    /**
     * @param value A set of adjustments that enable you to scale based on the size of the alarm breach.
     *  At least one step adjustment is required if you are adding a new step scaling policy configuration.
     */
    @JvmName("aykjcoivqafbqpsn")
    public suspend fun stepAdjustments(`value`: Output>) {
        this.stepAdjustments = value
    }

    @JvmName("eramjeotnthfotfd")
    public suspend fun stepAdjustments(vararg values: Output) {
        this.stepAdjustments = Output.all(values.asList())
    }

    /**
     * @param values A set of adjustments that enable you to scale based on the size of the alarm breach.
     *  At least one step adjustment is required if you are adding a new step scaling policy configuration.
     */
    @JvmName("kdsyclxbynojvllo")
    public suspend fun stepAdjustments(values: List>) {
        this.stepAdjustments = Output.all(values)
    }

    /**
     * @param value Specifies whether the ``ScalingAdjustment`` value in the ``StepAdjustment`` property is an absolute number or a percentage of the current capacity.
     */
    @JvmName("fibhpbxbteipahhp")
    public suspend fun adjustmentType(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.adjustmentType = mapped
    }

    /**
     * @param value The amount of time, in seconds, to wait for a previous scaling activity to take effect. If not specified, the default value is 300. For more information, see [Cooldown period](https://docs.aws.amazon.com/autoscaling/application/userguide/step-scaling-policy-overview.html#step-scaling-cooldown) in the *Application Auto Scaling User Guide*.
     */
    @JvmName("jynffwsmemtktujq")
    public suspend fun cooldown(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.cooldown = mapped
    }

    /**
     * @param value The aggregation type for the CloudWatch metrics. Valid values are ``Minimum``, ``Maximum``, and ``Average``. If the aggregation type is null, the value is treated as ``Average``.
     */
    @JvmName("lpydieyngvwswsea")
    public suspend fun metricAggregationType(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.metricAggregationType = mapped
    }

    /**
     * @param value The minimum value to scale by when the adjustment type is ``PercentChangeInCapacity``. For example, suppose that you create a step scaling policy to scale out an Amazon ECS service by 25 percent and you specify a ``MinAdjustmentMagnitude`` of 2. If the service has 4 tasks and the scaling policy is performed, 25 percent of 4 is 1. However, because you specified a ``MinAdjustmentMagnitude`` of 2, Application Auto Scaling scales out the service by 2 tasks.
     */
    @JvmName("ewmvewwrbbeglcpk")
    public suspend fun minAdjustmentMagnitude(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.minAdjustmentMagnitude = mapped
    }

    /**
     * @param value A set of adjustments that enable you to scale based on the size of the alarm breach.
     *  At least one step adjustment is required if you are adding a new step scaling policy configuration.
     */
    @JvmName("fcwqbryhvkgmpxgu")
    public suspend fun stepAdjustments(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.stepAdjustments = mapped
    }

    /**
     * @param argument A set of adjustments that enable you to scale based on the size of the alarm breach.
     *  At least one step adjustment is required if you are adding a new step scaling policy configuration.
     */
    @JvmName("shnycsdsayedxjlp")
    public suspend fun stepAdjustments(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            ScalingPolicyStepAdjustmentArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.stepAdjustments = mapped
    }

    /**
     * @param argument A set of adjustments that enable you to scale based on the size of the alarm breach.
     *  At least one step adjustment is required if you are adding a new step scaling policy configuration.
     */
    @JvmName("hdybwccfhacqynre")
    public suspend fun stepAdjustments(vararg argument: suspend ScalingPolicyStepAdjustmentArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            ScalingPolicyStepAdjustmentArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.stepAdjustments = mapped
    }

    /**
     * @param argument A set of adjustments that enable you to scale based on the size of the alarm breach.
     *  At least one step adjustment is required if you are adding a new step scaling policy configuration.
     */
    @JvmName("nkusrgdikiteddwv")
    public suspend fun stepAdjustments(argument: suspend ScalingPolicyStepAdjustmentArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(
            ScalingPolicyStepAdjustmentArgsBuilder().applySuspend {
                argument()
            }.build(),
        )
        val mapped = of(toBeMapped)
        this.stepAdjustments = mapped
    }

    /**
     * @param values A set of adjustments that enable you to scale based on the size of the alarm breach.
     *  At least one step adjustment is required if you are adding a new step scaling policy configuration.
     */
    @JvmName("fpfukuacmlaflfkw")
    public suspend fun stepAdjustments(vararg values: ScalingPolicyStepAdjustmentArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.stepAdjustments = mapped
    }

    internal fun build(): ScalingPolicyStepScalingPolicyConfigurationArgs =
        ScalingPolicyStepScalingPolicyConfigurationArgs(
            adjustmentType = adjustmentType,
            cooldown = cooldown,
            metricAggregationType = metricAggregationType,
            minAdjustmentMagnitude = minAdjustmentMagnitude,
            stepAdjustments = stepAdjustments,
        )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy