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

com.pulumi.gcp.compute.kotlin.inputs.InstanceGroupManagerUpdatePolicyArgs.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.13.1.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.InstanceGroupManagerUpdatePolicyArgs.builder
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiNullFieldException
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.Int
import kotlin.String
import kotlin.Suppress
import kotlin.jvm.JvmName

/**
 *
 * @property maxSurgeFixed , Specifies a fixed number of VM instances. This must be a positive integer. Conflicts with `max_surge_percent`. Both cannot be 0.
 * @property maxSurgePercent , Specifies a percentage of instances between 0 to 100%, inclusive. For example, specify 80 for 80%. Conflicts with `max_surge_fixed`.
 * @property maxUnavailableFixed , Specifies a fixed number of VM instances. This must be a positive integer.
 * @property maxUnavailablePercent , Specifies a percentage of instances between 0 to 100%, inclusive. For example, specify 80 for 80%..
 * @property minReadySec , Minimum number of seconds to wait for after a newly created instance becomes available. This value must be from range [0, 3600]
 * @property minimalAction Minimal action to be taken on an instance. You can specify either `NONE` to forbid any actions, `REFRESH` to update without stopping instances, `RESTART` to restart existing instances or `REPLACE` to delete and create new instances from the target template. If you specify a `REFRESH`, the Updater will attempt to perform that action only. However, if the Updater determines that the minimal action you specify is not enough to perform the update, it might perform a more disruptive action.
 * @property mostDisruptiveAllowedAction Most disruptive action that is allowed to be taken on an instance. You can specify either NONE to forbid any actions, REFRESH to allow actions that do not need instance restart, RESTART to allow actions that can be applied without instance replacing or REPLACE to allow all possible actions. If the Updater determines that the minimal update action needed is more disruptive than most disruptive allowed action you specify it will not perform the update at all.
 * @property replacementMethod , The instance replacement method for managed instance groups. Valid values are: "RECREATE", "SUBSTITUTE". If SUBSTITUTE (default), the group replaces VM instances with new instances that have randomly generated names. If RECREATE, instance names are preserved.  You must also set max_unavailable_fixed or max_unavailable_percent to be greater than 0.
 * - - -
 * @property type The type of update process. You can specify either `PROACTIVE` so that the instance group manager proactively executes actions in order to bring instances to their target versions or `OPPORTUNISTIC` so that no action is proactively executed but the update will be performed as part of other actions (for example, resizes or recreateInstances calls).
 */
public data class InstanceGroupManagerUpdatePolicyArgs(
    public val maxSurgeFixed: Output? = null,
    public val maxSurgePercent: Output? = null,
    public val maxUnavailableFixed: Output? = null,
    public val maxUnavailablePercent: Output? = null,
    public val minReadySec: Output? = null,
    public val minimalAction: Output,
    public val mostDisruptiveAllowedAction: Output? = null,
    public val replacementMethod: Output? = null,
    public val type: Output,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.gcp.compute.inputs.InstanceGroupManagerUpdatePolicyArgs =
        com.pulumi.gcp.compute.inputs.InstanceGroupManagerUpdatePolicyArgs.builder()
            .maxSurgeFixed(maxSurgeFixed?.applyValue({ args0 -> args0 }))
            .maxSurgePercent(maxSurgePercent?.applyValue({ args0 -> args0 }))
            .maxUnavailableFixed(maxUnavailableFixed?.applyValue({ args0 -> args0 }))
            .maxUnavailablePercent(maxUnavailablePercent?.applyValue({ args0 -> args0 }))
            .minReadySec(minReadySec?.applyValue({ args0 -> args0 }))
            .minimalAction(minimalAction.applyValue({ args0 -> args0 }))
            .mostDisruptiveAllowedAction(mostDisruptiveAllowedAction?.applyValue({ args0 -> args0 }))
            .replacementMethod(replacementMethod?.applyValue({ args0 -> args0 }))
            .type(type.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [InstanceGroupManagerUpdatePolicyArgs].
 */
@PulumiTagMarker
public class InstanceGroupManagerUpdatePolicyArgsBuilder internal constructor() {
    private var maxSurgeFixed: Output? = null

    private var maxSurgePercent: Output? = null

    private var maxUnavailableFixed: Output? = null

    private var maxUnavailablePercent: Output? = null

    private var minReadySec: Output? = null

    private var minimalAction: Output? = null

    private var mostDisruptiveAllowedAction: Output? = null

    private var replacementMethod: Output? = null

    private var type: Output? = null

    /**
     * @param value , Specifies a fixed number of VM instances. This must be a positive integer. Conflicts with `max_surge_percent`. Both cannot be 0.
     */
    @JvmName("cbqyjaolfscxcgmo")
    public suspend fun maxSurgeFixed(`value`: Output) {
        this.maxSurgeFixed = value
    }

    /**
     * @param value , Specifies a percentage of instances between 0 to 100%, inclusive. For example, specify 80 for 80%. Conflicts with `max_surge_fixed`.
     */
    @JvmName("wjjdmornokjvnrjn")
    public suspend fun maxSurgePercent(`value`: Output) {
        this.maxSurgePercent = value
    }

    /**
     * @param value , Specifies a fixed number of VM instances. This must be a positive integer.
     */
    @JvmName("favirhbcojsryxnd")
    public suspend fun maxUnavailableFixed(`value`: Output) {
        this.maxUnavailableFixed = value
    }

    /**
     * @param value , Specifies a percentage of instances between 0 to 100%, inclusive. For example, specify 80 for 80%..
     */
    @JvmName("vdxehhslrnybqejp")
    public suspend fun maxUnavailablePercent(`value`: Output) {
        this.maxUnavailablePercent = value
    }

    /**
     * @param value , Minimum number of seconds to wait for after a newly created instance becomes available. This value must be from range [0, 3600]
     */
    @JvmName("mnpvapjaajruawvh")
    public suspend fun minReadySec(`value`: Output) {
        this.minReadySec = value
    }

    /**
     * @param value Minimal action to be taken on an instance. You can specify either `NONE` to forbid any actions, `REFRESH` to update without stopping instances, `RESTART` to restart existing instances or `REPLACE` to delete and create new instances from the target template. If you specify a `REFRESH`, the Updater will attempt to perform that action only. However, if the Updater determines that the minimal action you specify is not enough to perform the update, it might perform a more disruptive action.
     */
    @JvmName("emrabwjrekfqscdc")
    public suspend fun minimalAction(`value`: Output) {
        this.minimalAction = value
    }

    /**
     * @param value Most disruptive action that is allowed to be taken on an instance. You can specify either NONE to forbid any actions, REFRESH to allow actions that do not need instance restart, RESTART to allow actions that can be applied without instance replacing or REPLACE to allow all possible actions. If the Updater determines that the minimal update action needed is more disruptive than most disruptive allowed action you specify it will not perform the update at all.
     */
    @JvmName("euhvveqxifcwlqqg")
    public suspend fun mostDisruptiveAllowedAction(`value`: Output) {
        this.mostDisruptiveAllowedAction = value
    }

    /**
     * @param value , The instance replacement method for managed instance groups. Valid values are: "RECREATE", "SUBSTITUTE". If SUBSTITUTE (default), the group replaces VM instances with new instances that have randomly generated names. If RECREATE, instance names are preserved.  You must also set max_unavailable_fixed or max_unavailable_percent to be greater than 0.
     * - - -
     */
    @JvmName("itsrcpbrkcolorlm")
    public suspend fun replacementMethod(`value`: Output) {
        this.replacementMethod = value
    }

    /**
     * @param value The type of update process. You can specify either `PROACTIVE` so that the instance group manager proactively executes actions in order to bring instances to their target versions or `OPPORTUNISTIC` so that no action is proactively executed but the update will be performed as part of other actions (for example, resizes or recreateInstances calls).
     */
    @JvmName("nklhebfmjstiwgqg")
    public suspend fun type(`value`: Output) {
        this.type = value
    }

    /**
     * @param value , Specifies a fixed number of VM instances. This must be a positive integer. Conflicts with `max_surge_percent`. Both cannot be 0.
     */
    @JvmName("pnegmmpiuadnfwyw")
    public suspend fun maxSurgeFixed(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.maxSurgeFixed = mapped
    }

    /**
     * @param value , Specifies a percentage of instances between 0 to 100%, inclusive. For example, specify 80 for 80%. Conflicts with `max_surge_fixed`.
     */
    @JvmName("paqtrhmkrivehqyq")
    public suspend fun maxSurgePercent(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.maxSurgePercent = mapped
    }

    /**
     * @param value , Specifies a fixed number of VM instances. This must be a positive integer.
     */
    @JvmName("nndppjbvxppwtcyx")
    public suspend fun maxUnavailableFixed(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.maxUnavailableFixed = mapped
    }

    /**
     * @param value , Specifies a percentage of instances between 0 to 100%, inclusive. For example, specify 80 for 80%..
     */
    @JvmName("uvvbilcwpvjbwyxi")
    public suspend fun maxUnavailablePercent(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.maxUnavailablePercent = mapped
    }

    /**
     * @param value , Minimum number of seconds to wait for after a newly created instance becomes available. This value must be from range [0, 3600]
     */
    @JvmName("ycvnqubasvayjcdc")
    public suspend fun minReadySec(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.minReadySec = mapped
    }

    /**
     * @param value Minimal action to be taken on an instance. You can specify either `NONE` to forbid any actions, `REFRESH` to update without stopping instances, `RESTART` to restart existing instances or `REPLACE` to delete and create new instances from the target template. If you specify a `REFRESH`, the Updater will attempt to perform that action only. However, if the Updater determines that the minimal action you specify is not enough to perform the update, it might perform a more disruptive action.
     */
    @JvmName("qjgpyhlycghmcrhl")
    public suspend fun minimalAction(`value`: String) {
        val toBeMapped = value
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.minimalAction = mapped
    }

    /**
     * @param value Most disruptive action that is allowed to be taken on an instance. You can specify either NONE to forbid any actions, REFRESH to allow actions that do not need instance restart, RESTART to allow actions that can be applied without instance replacing or REPLACE to allow all possible actions. If the Updater determines that the minimal update action needed is more disruptive than most disruptive allowed action you specify it will not perform the update at all.
     */
    @JvmName("ckouqbwgwoijgxia")
    public suspend fun mostDisruptiveAllowedAction(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.mostDisruptiveAllowedAction = mapped
    }

    /**
     * @param value , The instance replacement method for managed instance groups. Valid values are: "RECREATE", "SUBSTITUTE". If SUBSTITUTE (default), the group replaces VM instances with new instances that have randomly generated names. If RECREATE, instance names are preserved.  You must also set max_unavailable_fixed or max_unavailable_percent to be greater than 0.
     * - - -
     */
    @JvmName("dhnewgrlrovqyhwu")
    public suspend fun replacementMethod(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.replacementMethod = mapped
    }

    /**
     * @param value The type of update process. You can specify either `PROACTIVE` so that the instance group manager proactively executes actions in order to bring instances to their target versions or `OPPORTUNISTIC` so that no action is proactively executed but the update will be performed as part of other actions (for example, resizes or recreateInstances calls).
     */
    @JvmName("dakmmfsddhukictu")
    public suspend fun type(`value`: String) {
        val toBeMapped = value
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.type = mapped
    }

    internal fun build(): InstanceGroupManagerUpdatePolicyArgs = InstanceGroupManagerUpdatePolicyArgs(
        maxSurgeFixed = maxSurgeFixed,
        maxSurgePercent = maxSurgePercent,
        maxUnavailableFixed = maxUnavailableFixed,
        maxUnavailablePercent = maxUnavailablePercent,
        minReadySec = minReadySec,
        minimalAction = minimalAction ?: throw PulumiNullFieldException("minimalAction"),
        mostDisruptiveAllowedAction = mostDisruptiveAllowedAction,
        replacementMethod = replacementMethod,
        type = type ?: throw PulumiNullFieldException("type"),
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy