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

com.pulumi.gcp.compute.kotlin.inputs.RegionAutoscalerAutoscalingPolicyArgs.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: 8.10.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.gcp.compute.kotlin.inputs

import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.gcp.compute.inputs.RegionAutoscalerAutoscalingPolicyArgs.builder
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiNullFieldException
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

/**
 *
 * @property cooldownPeriod The number of seconds that the autoscaler should wait before it
 * starts collecting information from a new instance. This prevents
 * the autoscaler from collecting information when the instance is
 * initializing, during which the collected usage would not be
 * reliable. The default time autoscaler waits is 60 seconds.
 * Virtual machine initialization times might vary because of
 * numerous factors. We recommend that you test how long an
 * instance may take to initialize. To do this, create an instance
 * and time the startup process.
 * @property cpuUtilization Defines the CPU utilization policy that allows the autoscaler to
 * scale based on the average CPU utilization of a managed instance
 * group.
 * Structure is documented below.
 * @property loadBalancingUtilization Configuration parameters of autoscaling based on a load balancer.
 * Structure is documented below.
 * @property maxReplicas The maximum number of instances that the autoscaler can scale up
 * to. This is required when creating or updating an autoscaler. The
 * maximum number of replicas should not be lower than minimal number
 * of replicas.
 * @property metrics Configuration parameters of autoscaling based on a custom metric.
 * Structure is documented below.
 * @property minReplicas The minimum number of replicas that the autoscaler can scale down
 * to. This cannot be less than 0. If not provided, autoscaler will
 * choose a default value depending on maximum number of instances
 * allowed.
 * @property mode Defines operating mode for this policy.
 * @property scaleDownControl Defines scale down controls to reduce the risk of response latency
 * and outages due to abrupt scale-in events
 * Structure is documented below.
 * @property scaleInControl Defines scale in controls to reduce the risk of response latency
 * and outages due to abrupt scale-in events
 * Structure is documented below.
 * @property scalingSchedules Scaling schedules defined for an autoscaler. Multiple schedules can be set on an autoscaler and they can overlap.
 * Structure is documented below.
 */
public data class RegionAutoscalerAutoscalingPolicyArgs(
    public val cooldownPeriod: Output? = null,
    public val cpuUtilization: Output? = null,
    public val loadBalancingUtilization: Output? = null,
    public val maxReplicas: Output,
    public val metrics: Output>? = null,
    public val minReplicas: Output,
    public val mode: Output? = null,
    public val scaleDownControl: Output? =
        null,
    public val scaleInControl: Output? = null,
    public val scalingSchedules: Output>? =
        null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.gcp.compute.inputs.RegionAutoscalerAutoscalingPolicyArgs =
        com.pulumi.gcp.compute.inputs.RegionAutoscalerAutoscalingPolicyArgs.builder()
            .cooldownPeriod(cooldownPeriod?.applyValue({ args0 -> args0 }))
            .cpuUtilization(cpuUtilization?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .loadBalancingUtilization(
                loadBalancingUtilization?.applyValue({ args0 ->
                    args0.let({ args0 ->
                        args0.toJava()
                    })
                }),
            )
            .maxReplicas(maxReplicas.applyValue({ args0 -> args0 }))
            .metrics(
                metrics?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            )
            .minReplicas(minReplicas.applyValue({ args0 -> args0 }))
            .mode(mode?.applyValue({ args0 -> args0 }))
            .scaleDownControl(scaleDownControl?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .scaleInControl(scaleInControl?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .scalingSchedules(
                scalingSchedules?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            ).build()
}

/**
 * Builder for [RegionAutoscalerAutoscalingPolicyArgs].
 */
@PulumiTagMarker
public class RegionAutoscalerAutoscalingPolicyArgsBuilder internal constructor() {
    private var cooldownPeriod: Output? = null

    private var cpuUtilization: Output? = null

    private var loadBalancingUtilization:
        Output? = null

    private var maxReplicas: Output? = null

    private var metrics: Output>? = null

    private var minReplicas: Output? = null

    private var mode: Output? = null

    private var scaleDownControl: Output? =
        null

    private var scaleInControl: Output? = null

    private var scalingSchedules: Output>? =
        null

    /**
     * @param value The number of seconds that the autoscaler should wait before it
     * starts collecting information from a new instance. This prevents
     * the autoscaler from collecting information when the instance is
     * initializing, during which the collected usage would not be
     * reliable. The default time autoscaler waits is 60 seconds.
     * Virtual machine initialization times might vary because of
     * numerous factors. We recommend that you test how long an
     * instance may take to initialize. To do this, create an instance
     * and time the startup process.
     */
    @JvmName("bxqahbfjxpwpdwcq")
    public suspend fun cooldownPeriod(`value`: Output) {
        this.cooldownPeriod = value
    }

    /**
     * @param value Defines the CPU utilization policy that allows the autoscaler to
     * scale based on the average CPU utilization of a managed instance
     * group.
     * Structure is documented below.
     */
    @JvmName("kmantirsnnvubgmt")
    public suspend fun cpuUtilization(`value`: Output) {
        this.cpuUtilization = value
    }

    /**
     * @param value Configuration parameters of autoscaling based on a load balancer.
     * Structure is documented below.
     */
    @JvmName("amwrvadlxqckuhcf")
    public suspend fun loadBalancingUtilization(`value`: Output) {
        this.loadBalancingUtilization = value
    }

    /**
     * @param value The maximum number of instances that the autoscaler can scale up
     * to. This is required when creating or updating an autoscaler. The
     * maximum number of replicas should not be lower than minimal number
     * of replicas.
     */
    @JvmName("ejthevoapncigfxf")
    public suspend fun maxReplicas(`value`: Output) {
        this.maxReplicas = value
    }

    /**
     * @param value Configuration parameters of autoscaling based on a custom metric.
     * Structure is documented below.
     */
    @JvmName("ntdvwcwqqmicdsbo")
    public suspend fun metrics(`value`: Output>) {
        this.metrics = value
    }

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

    /**
     * @param values Configuration parameters of autoscaling based on a custom metric.
     * Structure is documented below.
     */
    @JvmName("qkixjexxbxndbdkn")
    public suspend fun metrics(values: List>) {
        this.metrics = Output.all(values)
    }

    /**
     * @param value The minimum number of replicas that the autoscaler can scale down
     * to. This cannot be less than 0. If not provided, autoscaler will
     * choose a default value depending on maximum number of instances
     * allowed.
     */
    @JvmName("qcylfvudeybqepua")
    public suspend fun minReplicas(`value`: Output) {
        this.minReplicas = value
    }

    /**
     * @param value Defines operating mode for this policy.
     */
    @JvmName("smmxdccfidswaevh")
    public suspend fun mode(`value`: Output) {
        this.mode = value
    }

    /**
     * @param value Defines scale down controls to reduce the risk of response latency
     * and outages due to abrupt scale-in events
     * Structure is documented below.
     */
    @JvmName("hkkavwgsqkxjpjee")
    public suspend fun scaleDownControl(`value`: Output) {
        this.scaleDownControl = value
    }

    /**
     * @param value Defines scale in controls to reduce the risk of response latency
     * and outages due to abrupt scale-in events
     * Structure is documented below.
     */
    @JvmName("iejbuqycyrfinytv")
    public suspend fun scaleInControl(`value`: Output) {
        this.scaleInControl = value
    }

    /**
     * @param value Scaling schedules defined for an autoscaler. Multiple schedules can be set on an autoscaler and they can overlap.
     * Structure is documented below.
     */
    @JvmName("fywsdugdxncefxis")
    public suspend fun scalingSchedules(`value`: Output>) {
        this.scalingSchedules = value
    }

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

    /**
     * @param values Scaling schedules defined for an autoscaler. Multiple schedules can be set on an autoscaler and they can overlap.
     * Structure is documented below.
     */
    @JvmName("mklxtcaywrrmmlwc")
    public suspend fun scalingSchedules(values: List>) {
        this.scalingSchedules = Output.all(values)
    }

    /**
     * @param value The number of seconds that the autoscaler should wait before it
     * starts collecting information from a new instance. This prevents
     * the autoscaler from collecting information when the instance is
     * initializing, during which the collected usage would not be
     * reliable. The default time autoscaler waits is 60 seconds.
     * Virtual machine initialization times might vary because of
     * numerous factors. We recommend that you test how long an
     * instance may take to initialize. To do this, create an instance
     * and time the startup process.
     */
    @JvmName("ilvplqykmodbgqpt")
    public suspend fun cooldownPeriod(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.cooldownPeriod = mapped
    }

    /**
     * @param value Defines the CPU utilization policy that allows the autoscaler to
     * scale based on the average CPU utilization of a managed instance
     * group.
     * Structure is documented below.
     */
    @JvmName("rhbmciqlgaleyeur")
    public suspend fun cpuUtilization(`value`: RegionAutoscalerAutoscalingPolicyCpuUtilizationArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.cpuUtilization = mapped
    }

    /**
     * @param argument Defines the CPU utilization policy that allows the autoscaler to
     * scale based on the average CPU utilization of a managed instance
     * group.
     * Structure is documented below.
     */
    @JvmName("nidrufcahxjnhpoy")
    public suspend fun cpuUtilization(argument: suspend RegionAutoscalerAutoscalingPolicyCpuUtilizationArgsBuilder.() -> Unit) {
        val toBeMapped = RegionAutoscalerAutoscalingPolicyCpuUtilizationArgsBuilder().applySuspend {
            argument()
        }.build()
        val mapped = of(toBeMapped)
        this.cpuUtilization = mapped
    }

    /**
     * @param value Configuration parameters of autoscaling based on a load balancer.
     * Structure is documented below.
     */
    @JvmName("rmxxlipfwuysopvw")
    public suspend fun loadBalancingUtilization(`value`: RegionAutoscalerAutoscalingPolicyLoadBalancingUtilizationArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.loadBalancingUtilization = mapped
    }

    /**
     * @param argument Configuration parameters of autoscaling based on a load balancer.
     * Structure is documented below.
     */
    @JvmName("ppykgxhnnuorbfxs")
    public suspend fun loadBalancingUtilization(argument: suspend RegionAutoscalerAutoscalingPolicyLoadBalancingUtilizationArgsBuilder.() -> Unit) {
        val toBeMapped =
            RegionAutoscalerAutoscalingPolicyLoadBalancingUtilizationArgsBuilder().applySuspend {
                argument()
            }.build()
        val mapped = of(toBeMapped)
        this.loadBalancingUtilization = mapped
    }

    /**
     * @param value The maximum number of instances that the autoscaler can scale up
     * to. This is required when creating or updating an autoscaler. The
     * maximum number of replicas should not be lower than minimal number
     * of replicas.
     */
    @JvmName("rmdiqyjjxbpioflk")
    public suspend fun maxReplicas(`value`: Int) {
        val toBeMapped = value
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.maxReplicas = mapped
    }

    /**
     * @param value Configuration parameters of autoscaling based on a custom metric.
     * Structure is documented below.
     */
    @JvmName("yhituwdhicupxrps")
    public suspend fun metrics(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.metrics = mapped
    }

    /**
     * @param argument Configuration parameters of autoscaling based on a custom metric.
     * Structure is documented below.
     */
    @JvmName("ybngumhiyvreuqsr")
    public suspend fun metrics(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            RegionAutoscalerAutoscalingPolicyMetricArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.metrics = mapped
    }

    /**
     * @param argument Configuration parameters of autoscaling based on a custom metric.
     * Structure is documented below.
     */
    @JvmName("jsabcadnqbegaraj")
    public suspend fun metrics(vararg argument: suspend RegionAutoscalerAutoscalingPolicyMetricArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            RegionAutoscalerAutoscalingPolicyMetricArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.metrics = mapped
    }

    /**
     * @param argument Configuration parameters of autoscaling based on a custom metric.
     * Structure is documented below.
     */
    @JvmName("nssmgkvojtvlxkdc")
    public suspend fun metrics(argument: suspend RegionAutoscalerAutoscalingPolicyMetricArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(
            RegionAutoscalerAutoscalingPolicyMetricArgsBuilder().applySuspend {
                argument()
            }.build(),
        )
        val mapped = of(toBeMapped)
        this.metrics = mapped
    }

    /**
     * @param values Configuration parameters of autoscaling based on a custom metric.
     * Structure is documented below.
     */
    @JvmName("djklwimtjxhdwsbk")
    public suspend fun metrics(vararg values: RegionAutoscalerAutoscalingPolicyMetricArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.metrics = mapped
    }

    /**
     * @param value The minimum number of replicas that the autoscaler can scale down
     * to. This cannot be less than 0. If not provided, autoscaler will
     * choose a default value depending on maximum number of instances
     * allowed.
     */
    @JvmName("sgaifognotfkpphf")
    public suspend fun minReplicas(`value`: Int) {
        val toBeMapped = value
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.minReplicas = mapped
    }

    /**
     * @param value Defines operating mode for this policy.
     */
    @JvmName("tpooucypgalamacc")
    public suspend fun mode(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.mode = mapped
    }

    /**
     * @param value Defines scale down controls to reduce the risk of response latency
     * and outages due to abrupt scale-in events
     * Structure is documented below.
     */
    @JvmName("vrqjevgenrxkbrrb")
    public suspend fun scaleDownControl(`value`: RegionAutoscalerAutoscalingPolicyScaleDownControlArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.scaleDownControl = mapped
    }

    /**
     * @param argument Defines scale down controls to reduce the risk of response latency
     * and outages due to abrupt scale-in events
     * Structure is documented below.
     */
    @JvmName("lsjufvvqwgoyxqpt")
    public suspend fun scaleDownControl(argument: suspend RegionAutoscalerAutoscalingPolicyScaleDownControlArgsBuilder.() -> Unit) {
        val toBeMapped = RegionAutoscalerAutoscalingPolicyScaleDownControlArgsBuilder().applySuspend {
            argument()
        }.build()
        val mapped = of(toBeMapped)
        this.scaleDownControl = mapped
    }

    /**
     * @param value Defines scale in controls to reduce the risk of response latency
     * and outages due to abrupt scale-in events
     * Structure is documented below.
     */
    @JvmName("ucqdpvytugufgras")
    public suspend fun scaleInControl(`value`: RegionAutoscalerAutoscalingPolicyScaleInControlArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.scaleInControl = mapped
    }

    /**
     * @param argument Defines scale in controls to reduce the risk of response latency
     * and outages due to abrupt scale-in events
     * Structure is documented below.
     */
    @JvmName("uidwcihvrcxtlpgh")
    public suspend fun scaleInControl(argument: suspend RegionAutoscalerAutoscalingPolicyScaleInControlArgsBuilder.() -> Unit) {
        val toBeMapped = RegionAutoscalerAutoscalingPolicyScaleInControlArgsBuilder().applySuspend {
            argument()
        }.build()
        val mapped = of(toBeMapped)
        this.scaleInControl = mapped
    }

    /**
     * @param value Scaling schedules defined for an autoscaler. Multiple schedules can be set on an autoscaler and they can overlap.
     * Structure is documented below.
     */
    @JvmName("cwyvbatovwebnrav")
    public suspend fun scalingSchedules(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.scalingSchedules = mapped
    }

    /**
     * @param argument Scaling schedules defined for an autoscaler. Multiple schedules can be set on an autoscaler and they can overlap.
     * Structure is documented below.
     */
    @JvmName("binfodtppssuhprq")
    public suspend fun scalingSchedules(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            RegionAutoscalerAutoscalingPolicyScalingScheduleArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.scalingSchedules = mapped
    }

    /**
     * @param argument Scaling schedules defined for an autoscaler. Multiple schedules can be set on an autoscaler and they can overlap.
     * Structure is documented below.
     */
    @JvmName("emttlmsrndfrsvih")
    public suspend fun scalingSchedules(vararg argument: suspend RegionAutoscalerAutoscalingPolicyScalingScheduleArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            RegionAutoscalerAutoscalingPolicyScalingScheduleArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.scalingSchedules = mapped
    }

    /**
     * @param argument Scaling schedules defined for an autoscaler. Multiple schedules can be set on an autoscaler and they can overlap.
     * Structure is documented below.
     */
    @JvmName("kmnhnmhkjxukhbmu")
    public suspend fun scalingSchedules(argument: suspend RegionAutoscalerAutoscalingPolicyScalingScheduleArgsBuilder.() -> Unit) {
        val toBeMapped =
            listOf(
                RegionAutoscalerAutoscalingPolicyScalingScheduleArgsBuilder().applySuspend {
                    argument()
                }.build(),
            )
        val mapped = of(toBeMapped)
        this.scalingSchedules = mapped
    }

    /**
     * @param values Scaling schedules defined for an autoscaler. Multiple schedules can be set on an autoscaler and they can overlap.
     * Structure is documented below.
     */
    @JvmName("xtjgqnugdrlgdeeo")
    public suspend fun scalingSchedules(vararg values: RegionAutoscalerAutoscalingPolicyScalingScheduleArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.scalingSchedules = mapped
    }

    internal fun build(): RegionAutoscalerAutoscalingPolicyArgs =
        RegionAutoscalerAutoscalingPolicyArgs(
            cooldownPeriod = cooldownPeriod,
            cpuUtilization = cpuUtilization,
            loadBalancingUtilization = loadBalancingUtilization,
            maxReplicas = maxReplicas ?: throw PulumiNullFieldException("maxReplicas"),
            metrics = metrics,
            minReplicas = minReplicas ?: throw PulumiNullFieldException("minReplicas"),
            mode = mode,
            scaleDownControl = scaleDownControl,
            scaleInControl = scaleInControl,
            scalingSchedules = scalingSchedules,
        )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy