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

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

package com.pulumi.azure.compute.kotlin.inputs

import com.pulumi.azure.compute.inputs.LinuxVirtualMachineScaleSetRollingUpgradePolicyArgs.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 kotlin.Boolean
import kotlin.Int
import kotlin.String
import kotlin.Suppress
import kotlin.jvm.JvmName

/**
 *
 * @property crossZoneUpgradesEnabled Should the Virtual Machine Scale Set ignore the Azure Zone boundaries when constructing upgrade batches? Possible values are `true` or `false`.
 * @property maxBatchInstancePercent The maximum percent of total virtual machine instances that will be upgraded simultaneously by the rolling upgrade in one batch. As this is a maximum, unhealthy instances in previous or future batches can cause the percentage of instances in a batch to decrease to ensure higher reliability.
 * @property maxUnhealthyInstancePercent The maximum percentage of the total virtual machine instances in the scale set that can be simultaneously unhealthy, either as a result of being upgraded, or by being found in an unhealthy state by the virtual machine health checks before the rolling upgrade aborts. This constraint will be checked prior to starting any batch.
 * @property maxUnhealthyUpgradedInstancePercent The maximum percentage of upgraded virtual machine instances that can be found to be in an unhealthy state. This check will happen after each batch is upgraded. If this percentage is ever exceeded, the rolling update aborts.
 * @property maximumSurgeInstancesEnabled Create new virtual machines to upgrade the scale set, rather than updating the existing virtual machines. Existing virtual machines will be deleted once the new virtual machines are created for each batch. Possible values are `true` or `false`.
 * > **NOTE:** `overprovision` must be set to `false` when `maximum_surge_instances_enabled` is specified.
 * @property pauseTimeBetweenBatches The wait time between completing the update for all virtual machines in one batch and starting the next batch. The time duration should be specified in ISO 8601 format.
 * @property prioritizeUnhealthyInstancesEnabled Upgrade all unhealthy instances in a scale set before any healthy instances. Possible values are `true` or `false`.
 */
public data class LinuxVirtualMachineScaleSetRollingUpgradePolicyArgs(
    public val crossZoneUpgradesEnabled: Output? = null,
    public val maxBatchInstancePercent: Output,
    public val maxUnhealthyInstancePercent: Output,
    public val maxUnhealthyUpgradedInstancePercent: Output,
    public val maximumSurgeInstancesEnabled: Output? = null,
    public val pauseTimeBetweenBatches: Output,
    public val prioritizeUnhealthyInstancesEnabled: Output? = null,
) :
    ConvertibleToJava {
    override fun toJava():
        com.pulumi.azure.compute.inputs.LinuxVirtualMachineScaleSetRollingUpgradePolicyArgs =
        com.pulumi.azure.compute.inputs.LinuxVirtualMachineScaleSetRollingUpgradePolicyArgs.builder()
            .crossZoneUpgradesEnabled(crossZoneUpgradesEnabled?.applyValue({ args0 -> args0 }))
            .maxBatchInstancePercent(maxBatchInstancePercent.applyValue({ args0 -> args0 }))
            .maxUnhealthyInstancePercent(maxUnhealthyInstancePercent.applyValue({ args0 -> args0 }))
            .maxUnhealthyUpgradedInstancePercent(
                maxUnhealthyUpgradedInstancePercent.applyValue({ args0 ->
                    args0
                }),
            )
            .maximumSurgeInstancesEnabled(maximumSurgeInstancesEnabled?.applyValue({ args0 -> args0 }))
            .pauseTimeBetweenBatches(pauseTimeBetweenBatches.applyValue({ args0 -> args0 }))
            .prioritizeUnhealthyInstancesEnabled(
                prioritizeUnhealthyInstancesEnabled?.applyValue({ args0 ->
                    args0
                }),
            ).build()
}

/**
 * Builder for [LinuxVirtualMachineScaleSetRollingUpgradePolicyArgs].
 */
@PulumiTagMarker
public class LinuxVirtualMachineScaleSetRollingUpgradePolicyArgsBuilder internal constructor() {
    private var crossZoneUpgradesEnabled: Output? = null

    private var maxBatchInstancePercent: Output? = null

    private var maxUnhealthyInstancePercent: Output? = null

    private var maxUnhealthyUpgradedInstancePercent: Output? = null

    private var maximumSurgeInstancesEnabled: Output? = null

    private var pauseTimeBetweenBatches: Output? = null

    private var prioritizeUnhealthyInstancesEnabled: Output? = null

    /**
     * @param value Should the Virtual Machine Scale Set ignore the Azure Zone boundaries when constructing upgrade batches? Possible values are `true` or `false`.
     */
    @JvmName("xywemeaiavlflfvi")
    public suspend fun crossZoneUpgradesEnabled(`value`: Output) {
        this.crossZoneUpgradesEnabled = value
    }

    /**
     * @param value The maximum percent of total virtual machine instances that will be upgraded simultaneously by the rolling upgrade in one batch. As this is a maximum, unhealthy instances in previous or future batches can cause the percentage of instances in a batch to decrease to ensure higher reliability.
     */
    @JvmName("meadostxgrfcqcrj")
    public suspend fun maxBatchInstancePercent(`value`: Output) {
        this.maxBatchInstancePercent = value
    }

    /**
     * @param value The maximum percentage of the total virtual machine instances in the scale set that can be simultaneously unhealthy, either as a result of being upgraded, or by being found in an unhealthy state by the virtual machine health checks before the rolling upgrade aborts. This constraint will be checked prior to starting any batch.
     */
    @JvmName("rerrmbqcgtnxjulq")
    public suspend fun maxUnhealthyInstancePercent(`value`: Output) {
        this.maxUnhealthyInstancePercent = value
    }

    /**
     * @param value The maximum percentage of upgraded virtual machine instances that can be found to be in an unhealthy state. This check will happen after each batch is upgraded. If this percentage is ever exceeded, the rolling update aborts.
     */
    @JvmName("gcvjchbsehfmgctc")
    public suspend fun maxUnhealthyUpgradedInstancePercent(`value`: Output) {
        this.maxUnhealthyUpgradedInstancePercent = value
    }

    /**
     * @param value Create new virtual machines to upgrade the scale set, rather than updating the existing virtual machines. Existing virtual machines will be deleted once the new virtual machines are created for each batch. Possible values are `true` or `false`.
     * > **NOTE:** `overprovision` must be set to `false` when `maximum_surge_instances_enabled` is specified.
     */
    @JvmName("okgqegvjbpyygfmf")
    public suspend fun maximumSurgeInstancesEnabled(`value`: Output) {
        this.maximumSurgeInstancesEnabled = value
    }

    /**
     * @param value The wait time between completing the update for all virtual machines in one batch and starting the next batch. The time duration should be specified in ISO 8601 format.
     */
    @JvmName("yepuhrfaukpnjaab")
    public suspend fun pauseTimeBetweenBatches(`value`: Output) {
        this.pauseTimeBetweenBatches = value
    }

    /**
     * @param value Upgrade all unhealthy instances in a scale set before any healthy instances. Possible values are `true` or `false`.
     */
    @JvmName("vxvvwbfermbjijgr")
    public suspend fun prioritizeUnhealthyInstancesEnabled(`value`: Output) {
        this.prioritizeUnhealthyInstancesEnabled = value
    }

    /**
     * @param value Should the Virtual Machine Scale Set ignore the Azure Zone boundaries when constructing upgrade batches? Possible values are `true` or `false`.
     */
    @JvmName("dkuffowfouhdobpl")
    public suspend fun crossZoneUpgradesEnabled(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.crossZoneUpgradesEnabled = mapped
    }

    /**
     * @param value The maximum percent of total virtual machine instances that will be upgraded simultaneously by the rolling upgrade in one batch. As this is a maximum, unhealthy instances in previous or future batches can cause the percentage of instances in a batch to decrease to ensure higher reliability.
     */
    @JvmName("flimtxcbfhwtqove")
    public suspend fun maxBatchInstancePercent(`value`: Int) {
        val toBeMapped = value
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.maxBatchInstancePercent = mapped
    }

    /**
     * @param value The maximum percentage of the total virtual machine instances in the scale set that can be simultaneously unhealthy, either as a result of being upgraded, or by being found in an unhealthy state by the virtual machine health checks before the rolling upgrade aborts. This constraint will be checked prior to starting any batch.
     */
    @JvmName("nwdmjtkrqsknhiad")
    public suspend fun maxUnhealthyInstancePercent(`value`: Int) {
        val toBeMapped = value
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.maxUnhealthyInstancePercent = mapped
    }

    /**
     * @param value The maximum percentage of upgraded virtual machine instances that can be found to be in an unhealthy state. This check will happen after each batch is upgraded. If this percentage is ever exceeded, the rolling update aborts.
     */
    @JvmName("whcpjtygvqjacqon")
    public suspend fun maxUnhealthyUpgradedInstancePercent(`value`: Int) {
        val toBeMapped = value
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.maxUnhealthyUpgradedInstancePercent = mapped
    }

    /**
     * @param value Create new virtual machines to upgrade the scale set, rather than updating the existing virtual machines. Existing virtual machines will be deleted once the new virtual machines are created for each batch. Possible values are `true` or `false`.
     * > **NOTE:** `overprovision` must be set to `false` when `maximum_surge_instances_enabled` is specified.
     */
    @JvmName("idufqidbrfijhyan")
    public suspend fun maximumSurgeInstancesEnabled(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.maximumSurgeInstancesEnabled = mapped
    }

    /**
     * @param value The wait time between completing the update for all virtual machines in one batch and starting the next batch. The time duration should be specified in ISO 8601 format.
     */
    @JvmName("ahqvbpipnmdpulgn")
    public suspend fun pauseTimeBetweenBatches(`value`: String) {
        val toBeMapped = value
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.pauseTimeBetweenBatches = mapped
    }

    /**
     * @param value Upgrade all unhealthy instances in a scale set before any healthy instances. Possible values are `true` or `false`.
     */
    @JvmName("katonjtmpgdyaumr")
    public suspend fun prioritizeUnhealthyInstancesEnabled(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.prioritizeUnhealthyInstancesEnabled = mapped
    }

    internal fun build(): LinuxVirtualMachineScaleSetRollingUpgradePolicyArgs =
        LinuxVirtualMachineScaleSetRollingUpgradePolicyArgs(
            crossZoneUpgradesEnabled = crossZoneUpgradesEnabled,
            maxBatchInstancePercent = maxBatchInstancePercent ?: throw
                PulumiNullFieldException("maxBatchInstancePercent"),
            maxUnhealthyInstancePercent = maxUnhealthyInstancePercent ?: throw
                PulumiNullFieldException("maxUnhealthyInstancePercent"),
            maxUnhealthyUpgradedInstancePercent = maxUnhealthyUpgradedInstancePercent ?: throw
                PulumiNullFieldException("maxUnhealthyUpgradedInstancePercent"),
            maximumSurgeInstancesEnabled = maximumSurgeInstancesEnabled,
            pauseTimeBetweenBatches = pauseTimeBetweenBatches ?: throw
                PulumiNullFieldException("pauseTimeBetweenBatches"),
            prioritizeUnhealthyInstancesEnabled = prioritizeUnhealthyInstancesEnabled,
        )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy