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

com.pulumi.gcp.compute.kotlin.inputs.InstanceTemplateSchedulingArgs.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.InstanceTemplateSchedulingArgs.builder
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.Boolean
import kotlin.Int
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.jvm.JvmName

/**
 *
 * @property automaticRestart Specifies whether the instance should be
 * automatically restarted if it is terminated by Compute Engine (not
 * terminated by a user). This defaults to true.
 * @property hostErrorTimeoutSeconds Specifies the time in seconds for host error detection, the value must be within the range of [90, 330] with the increment of 30, if unset, the default behavior of host error recovery will be used.
 * @property instanceTerminationAction Describe the type of termination action for `SPOT` VM. Can be `STOP` or `DELETE`.  Read more on [here](https://cloud.google.com/compute/docs/instances/create-use-spot)
 * @property localSsdRecoveryTimeouts Specifies the maximum amount of time a Local Ssd Vm should wait while
 *   recovery of the Local Ssd state is attempted. Its value should be in
 *   between 0 and 168 hours with hour granularity and the default value being 1
 *   hour.
 * @property maintenanceInterval Specifies the frequency of planned maintenance events. The accepted values are: `PERIODIC`.
 * @property maxRunDuration The duration of the instance. Instance will run and be terminated after then, the termination action could be defined in `instance_termination_action`. Structure is documented below.
 * @property minNodeCpus Minimum number of cpus for the instance.
 * @property nodeAffinities Specifies node affinities or anti-affinities
 * to determine which sole-tenant nodes your instances and managed instance
 * groups will use as host systems. Read more on sole-tenant node creation
 * [here](https://cloud.google.com/compute/docs/nodes/create-nodes).
 * Structure documented below.
 * @property onHostMaintenance Defines the maintenance behavior for this
 * instance.
 * @property onInstanceStopAction Specifies the action to be performed when the instance is terminated using `max_run_duration` and `STOP` `instance_termination_action`. Only support `true` `discard_local_ssd` at this point. Structure is documented below.
 * @property preemptible Allows instance to be preempted. This defaults to
 * false. Read more on this
 * [here](https://cloud.google.com/compute/docs/instances/preemptible).
 * @property provisioningModel Describe the type of preemptible VM. This field accepts the value `STANDARD` or `SPOT`. If the value is `STANDARD`, there will be no discount. If this   is set to `SPOT`,
 * `preemptible` should be `true` and `automatic_restart` should be
 * `false`. For more info about
 * `SPOT`, read [here](https://cloud.google.com/compute/docs/instances/spot)
 */
public data class InstanceTemplateSchedulingArgs(
    public val automaticRestart: Output? = null,
    public val hostErrorTimeoutSeconds: Output? = null,
    public val instanceTerminationAction: Output? = null,
    public val localSsdRecoveryTimeouts: Output>? = null,
    public val maintenanceInterval: Output? = null,
    public val maxRunDuration: Output? = null,
    public val minNodeCpus: Output? = null,
    public val nodeAffinities: Output>? = null,
    public val onHostMaintenance: Output? = null,
    public val onInstanceStopAction: Output? =
        null,
    public val preemptible: Output? = null,
    public val provisioningModel: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.gcp.compute.inputs.InstanceTemplateSchedulingArgs =
        com.pulumi.gcp.compute.inputs.InstanceTemplateSchedulingArgs.builder()
            .automaticRestart(automaticRestart?.applyValue({ args0 -> args0 }))
            .hostErrorTimeoutSeconds(hostErrorTimeoutSeconds?.applyValue({ args0 -> args0 }))
            .instanceTerminationAction(instanceTerminationAction?.applyValue({ args0 -> args0 }))
            .localSsdRecoveryTimeouts(
                localSsdRecoveryTimeouts?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 -> args0.toJava() })
                    })
                }),
            )
            .maintenanceInterval(maintenanceInterval?.applyValue({ args0 -> args0 }))
            .maxRunDuration(maxRunDuration?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .minNodeCpus(minNodeCpus?.applyValue({ args0 -> args0 }))
            .nodeAffinities(
                nodeAffinities?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            )
            .onHostMaintenance(onHostMaintenance?.applyValue({ args0 -> args0 }))
            .onInstanceStopAction(
                onInstanceStopAction?.applyValue({ args0 ->
                    args0.let({ args0 ->
                        args0.toJava()
                    })
                }),
            )
            .preemptible(preemptible?.applyValue({ args0 -> args0 }))
            .provisioningModel(provisioningModel?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [InstanceTemplateSchedulingArgs].
 */
@PulumiTagMarker
public class InstanceTemplateSchedulingArgsBuilder internal constructor() {
    private var automaticRestart: Output? = null

    private var hostErrorTimeoutSeconds: Output? = null

    private var instanceTerminationAction: Output? = null

    private var localSsdRecoveryTimeouts:
        Output>? = null

    private var maintenanceInterval: Output? = null

    private var maxRunDuration: Output? = null

    private var minNodeCpus: Output? = null

    private var nodeAffinities: Output>? = null

    private var onHostMaintenance: Output? = null

    private var onInstanceStopAction: Output? =
        null

    private var preemptible: Output? = null

    private var provisioningModel: Output? = null

    /**
     * @param value Specifies whether the instance should be
     * automatically restarted if it is terminated by Compute Engine (not
     * terminated by a user). This defaults to true.
     */
    @JvmName("glfwsypvrhkbdtcm")
    public suspend fun automaticRestart(`value`: Output) {
        this.automaticRestart = value
    }

    /**
     * @param value Specifies the time in seconds for host error detection, the value must be within the range of [90, 330] with the increment of 30, if unset, the default behavior of host error recovery will be used.
     */
    @JvmName("mlaosxwmdglrlelu")
    public suspend fun hostErrorTimeoutSeconds(`value`: Output) {
        this.hostErrorTimeoutSeconds = value
    }

    /**
     * @param value Describe the type of termination action for `SPOT` VM. Can be `STOP` or `DELETE`.  Read more on [here](https://cloud.google.com/compute/docs/instances/create-use-spot)
     */
    @JvmName("srlvwlkgnenmxxia")
    public suspend fun instanceTerminationAction(`value`: Output) {
        this.instanceTerminationAction = value
    }

    /**
     * @param value Specifies the maximum amount of time a Local Ssd Vm should wait while
     *   recovery of the Local Ssd state is attempted. Its value should be in
     *   between 0 and 168 hours with hour granularity and the default value being 1
     *   hour.
     */
    @JvmName("deoeppnrbbutxggr")
    public suspend fun localSsdRecoveryTimeouts(`value`: Output>) {
        this.localSsdRecoveryTimeouts = value
    }

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

    /**
     * @param values Specifies the maximum amount of time a Local Ssd Vm should wait while
     *   recovery of the Local Ssd state is attempted. Its value should be in
     *   between 0 and 168 hours with hour granularity and the default value being 1
     *   hour.
     */
    @JvmName("ssuetmnprqmbcpys")
    public suspend fun localSsdRecoveryTimeouts(values: List>) {
        this.localSsdRecoveryTimeouts = Output.all(values)
    }

    /**
     * @param value Specifies the frequency of planned maintenance events. The accepted values are: `PERIODIC`.
     */
    @JvmName("wttcybpwdmopmnhq")
    public suspend fun maintenanceInterval(`value`: Output) {
        this.maintenanceInterval = value
    }

    /**
     * @param value The duration of the instance. Instance will run and be terminated after then, the termination action could be defined in `instance_termination_action`. Structure is documented below.
     */
    @JvmName("xggsmxivmbxvkoxg")
    public suspend fun maxRunDuration(`value`: Output) {
        this.maxRunDuration = value
    }

    /**
     * @param value Minimum number of cpus for the instance.
     */
    @JvmName("fpqiopuopwbtpuog")
    public suspend fun minNodeCpus(`value`: Output) {
        this.minNodeCpus = value
    }

    /**
     * @param value Specifies node affinities or anti-affinities
     * to determine which sole-tenant nodes your instances and managed instance
     * groups will use as host systems. Read more on sole-tenant node creation
     * [here](https://cloud.google.com/compute/docs/nodes/create-nodes).
     * Structure documented below.
     */
    @JvmName("gxwoqmvnfobxluvf")
    public suspend fun nodeAffinities(`value`: Output>) {
        this.nodeAffinities = value
    }

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

    /**
     * @param values Specifies node affinities or anti-affinities
     * to determine which sole-tenant nodes your instances and managed instance
     * groups will use as host systems. Read more on sole-tenant node creation
     * [here](https://cloud.google.com/compute/docs/nodes/create-nodes).
     * Structure documented below.
     */
    @JvmName("lgadavrnyagphjyc")
    public suspend fun nodeAffinities(values: List>) {
        this.nodeAffinities = Output.all(values)
    }

    /**
     * @param value Defines the maintenance behavior for this
     * instance.
     */
    @JvmName("ugphgayimexjnyll")
    public suspend fun onHostMaintenance(`value`: Output) {
        this.onHostMaintenance = value
    }

    /**
     * @param value Specifies the action to be performed when the instance is terminated using `max_run_duration` and `STOP` `instance_termination_action`. Only support `true` `discard_local_ssd` at this point. Structure is documented below.
     */
    @JvmName("qftsagrvguynvihh")
    public suspend fun onInstanceStopAction(`value`: Output) {
        this.onInstanceStopAction = value
    }

    /**
     * @param value Allows instance to be preempted. This defaults to
     * false. Read more on this
     * [here](https://cloud.google.com/compute/docs/instances/preemptible).
     */
    @JvmName("aarrgstclahqoskg")
    public suspend fun preemptible(`value`: Output) {
        this.preemptible = value
    }

    /**
     * @param value Describe the type of preemptible VM. This field accepts the value `STANDARD` or `SPOT`. If the value is `STANDARD`, there will be no discount. If this   is set to `SPOT`,
     * `preemptible` should be `true` and `automatic_restart` should be
     * `false`. For more info about
     * `SPOT`, read [here](https://cloud.google.com/compute/docs/instances/spot)
     */
    @JvmName("eosspfjhjytdtnkj")
    public suspend fun provisioningModel(`value`: Output) {
        this.provisioningModel = value
    }

    /**
     * @param value Specifies whether the instance should be
     * automatically restarted if it is terminated by Compute Engine (not
     * terminated by a user). This defaults to true.
     */
    @JvmName("hcqqmeujlvhtfvpf")
    public suspend fun automaticRestart(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.automaticRestart = mapped
    }

    /**
     * @param value Specifies the time in seconds for host error detection, the value must be within the range of [90, 330] with the increment of 30, if unset, the default behavior of host error recovery will be used.
     */
    @JvmName("ncvnkhxllapasehn")
    public suspend fun hostErrorTimeoutSeconds(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.hostErrorTimeoutSeconds = mapped
    }

    /**
     * @param value Describe the type of termination action for `SPOT` VM. Can be `STOP` or `DELETE`.  Read more on [here](https://cloud.google.com/compute/docs/instances/create-use-spot)
     */
    @JvmName("kdrnrixkgaqtvoig")
    public suspend fun instanceTerminationAction(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.instanceTerminationAction = mapped
    }

    /**
     * @param value Specifies the maximum amount of time a Local Ssd Vm should wait while
     *   recovery of the Local Ssd state is attempted. Its value should be in
     *   between 0 and 168 hours with hour granularity and the default value being 1
     *   hour.
     */
    @JvmName("rjddqocjfwesjvvx")
    public suspend fun localSsdRecoveryTimeouts(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.localSsdRecoveryTimeouts = mapped
    }

    /**
     * @param argument Specifies the maximum amount of time a Local Ssd Vm should wait while
     *   recovery of the Local Ssd state is attempted. Its value should be in
     *   between 0 and 168 hours with hour granularity and the default value being 1
     *   hour.
     */
    @JvmName("wxtikiektlwnjcpn")
    public suspend fun localSsdRecoveryTimeouts(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            InstanceTemplateSchedulingLocalSsdRecoveryTimeoutArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.localSsdRecoveryTimeouts = mapped
    }

    /**
     * @param argument Specifies the maximum amount of time a Local Ssd Vm should wait while
     *   recovery of the Local Ssd state is attempted. Its value should be in
     *   between 0 and 168 hours with hour granularity and the default value being 1
     *   hour.
     */
    @JvmName("rfxkxmdvdqkuenbg")
    public suspend fun localSsdRecoveryTimeouts(vararg argument: suspend InstanceTemplateSchedulingLocalSsdRecoveryTimeoutArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            InstanceTemplateSchedulingLocalSsdRecoveryTimeoutArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.localSsdRecoveryTimeouts = mapped
    }

    /**
     * @param argument Specifies the maximum amount of time a Local Ssd Vm should wait while
     *   recovery of the Local Ssd state is attempted. Its value should be in
     *   between 0 and 168 hours with hour granularity and the default value being 1
     *   hour.
     */
    @JvmName("ntxgyypreqxpogtj")
    public suspend fun localSsdRecoveryTimeouts(argument: suspend InstanceTemplateSchedulingLocalSsdRecoveryTimeoutArgsBuilder.() -> Unit) {
        val toBeMapped =
            listOf(
                InstanceTemplateSchedulingLocalSsdRecoveryTimeoutArgsBuilder().applySuspend {
                    argument()
                }.build(),
            )
        val mapped = of(toBeMapped)
        this.localSsdRecoveryTimeouts = mapped
    }

    /**
     * @param values Specifies the maximum amount of time a Local Ssd Vm should wait while
     *   recovery of the Local Ssd state is attempted. Its value should be in
     *   between 0 and 168 hours with hour granularity and the default value being 1
     *   hour.
     */
    @JvmName("pqhpbxjcfvlayhmd")
    public suspend fun localSsdRecoveryTimeouts(vararg values: InstanceTemplateSchedulingLocalSsdRecoveryTimeoutArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.localSsdRecoveryTimeouts = mapped
    }

    /**
     * @param value Specifies the frequency of planned maintenance events. The accepted values are: `PERIODIC`.
     */
    @JvmName("hgiolcdmqpdwdvja")
    public suspend fun maintenanceInterval(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.maintenanceInterval = mapped
    }

    /**
     * @param value The duration of the instance. Instance will run and be terminated after then, the termination action could be defined in `instance_termination_action`. Structure is documented below.
     */
    @JvmName("eutvfvabguwuyjks")
    public suspend fun maxRunDuration(`value`: InstanceTemplateSchedulingMaxRunDurationArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.maxRunDuration = mapped
    }

    /**
     * @param argument The duration of the instance. Instance will run and be terminated after then, the termination action could be defined in `instance_termination_action`. Structure is documented below.
     */
    @JvmName("vobnpvlhidfoxqmq")
    public suspend fun maxRunDuration(argument: suspend InstanceTemplateSchedulingMaxRunDurationArgsBuilder.() -> Unit) {
        val toBeMapped = InstanceTemplateSchedulingMaxRunDurationArgsBuilder().applySuspend {
            argument()
        }.build()
        val mapped = of(toBeMapped)
        this.maxRunDuration = mapped
    }

    /**
     * @param value Minimum number of cpus for the instance.
     */
    @JvmName("yaijgjqvbjbaegfy")
    public suspend fun minNodeCpus(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.minNodeCpus = mapped
    }

    /**
     * @param value Specifies node affinities or anti-affinities
     * to determine which sole-tenant nodes your instances and managed instance
     * groups will use as host systems. Read more on sole-tenant node creation
     * [here](https://cloud.google.com/compute/docs/nodes/create-nodes).
     * Structure documented below.
     */
    @JvmName("cypxljevtowslypx")
    public suspend fun nodeAffinities(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.nodeAffinities = mapped
    }

    /**
     * @param argument Specifies node affinities or anti-affinities
     * to determine which sole-tenant nodes your instances and managed instance
     * groups will use as host systems. Read more on sole-tenant node creation
     * [here](https://cloud.google.com/compute/docs/nodes/create-nodes).
     * Structure documented below.
     */
    @JvmName("figdakvcfpkobplc")
    public suspend fun nodeAffinities(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            InstanceTemplateSchedulingNodeAffinityArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.nodeAffinities = mapped
    }

    /**
     * @param argument Specifies node affinities or anti-affinities
     * to determine which sole-tenant nodes your instances and managed instance
     * groups will use as host systems. Read more on sole-tenant node creation
     * [here](https://cloud.google.com/compute/docs/nodes/create-nodes).
     * Structure documented below.
     */
    @JvmName("bjnrafinmleoyrww")
    public suspend fun nodeAffinities(vararg argument: suspend InstanceTemplateSchedulingNodeAffinityArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            InstanceTemplateSchedulingNodeAffinityArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.nodeAffinities = mapped
    }

    /**
     * @param argument Specifies node affinities or anti-affinities
     * to determine which sole-tenant nodes your instances and managed instance
     * groups will use as host systems. Read more on sole-tenant node creation
     * [here](https://cloud.google.com/compute/docs/nodes/create-nodes).
     * Structure documented below.
     */
    @JvmName("vlhrcgekqontvyme")
    public suspend fun nodeAffinities(argument: suspend InstanceTemplateSchedulingNodeAffinityArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(
            InstanceTemplateSchedulingNodeAffinityArgsBuilder().applySuspend {
                argument()
            }.build(),
        )
        val mapped = of(toBeMapped)
        this.nodeAffinities = mapped
    }

    /**
     * @param values Specifies node affinities or anti-affinities
     * to determine which sole-tenant nodes your instances and managed instance
     * groups will use as host systems. Read more on sole-tenant node creation
     * [here](https://cloud.google.com/compute/docs/nodes/create-nodes).
     * Structure documented below.
     */
    @JvmName("xuljyykvrirmegug")
    public suspend fun nodeAffinities(vararg values: InstanceTemplateSchedulingNodeAffinityArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.nodeAffinities = mapped
    }

    /**
     * @param value Defines the maintenance behavior for this
     * instance.
     */
    @JvmName("bqpejugymdqarlvt")
    public suspend fun onHostMaintenance(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.onHostMaintenance = mapped
    }

    /**
     * @param value Specifies the action to be performed when the instance is terminated using `max_run_duration` and `STOP` `instance_termination_action`. Only support `true` `discard_local_ssd` at this point. Structure is documented below.
     */
    @JvmName("xouydukshsupateo")
    public suspend fun onInstanceStopAction(`value`: InstanceTemplateSchedulingOnInstanceStopActionArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.onInstanceStopAction = mapped
    }

    /**
     * @param argument Specifies the action to be performed when the instance is terminated using `max_run_duration` and `STOP` `instance_termination_action`. Only support `true` `discard_local_ssd` at this point. Structure is documented below.
     */
    @JvmName("rixiqijghtsnfcna")
    public suspend fun onInstanceStopAction(argument: suspend InstanceTemplateSchedulingOnInstanceStopActionArgsBuilder.() -> Unit) {
        val toBeMapped = InstanceTemplateSchedulingOnInstanceStopActionArgsBuilder().applySuspend {
            argument()
        }.build()
        val mapped = of(toBeMapped)
        this.onInstanceStopAction = mapped
    }

    /**
     * @param value Allows instance to be preempted. This defaults to
     * false. Read more on this
     * [here](https://cloud.google.com/compute/docs/instances/preemptible).
     */
    @JvmName("xswltcuireatxmfn")
    public suspend fun preemptible(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.preemptible = mapped
    }

    /**
     * @param value Describe the type of preemptible VM. This field accepts the value `STANDARD` or `SPOT`. If the value is `STANDARD`, there will be no discount. If this   is set to `SPOT`,
     * `preemptible` should be `true` and `automatic_restart` should be
     * `false`. For more info about
     * `SPOT`, read [here](https://cloud.google.com/compute/docs/instances/spot)
     */
    @JvmName("ysrodfnjthwtpbxb")
    public suspend fun provisioningModel(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.provisioningModel = mapped
    }

    internal fun build(): InstanceTemplateSchedulingArgs = InstanceTemplateSchedulingArgs(
        automaticRestart = automaticRestart,
        hostErrorTimeoutSeconds = hostErrorTimeoutSeconds,
        instanceTerminationAction = instanceTerminationAction,
        localSsdRecoveryTimeouts = localSsdRecoveryTimeouts,
        maintenanceInterval = maintenanceInterval,
        maxRunDuration = maxRunDuration,
        minNodeCpus = minNodeCpus,
        nodeAffinities = nodeAffinities,
        onHostMaintenance = onHostMaintenance,
        onInstanceStopAction = onInstanceStopAction,
        preemptible = preemptible,
        provisioningModel = provisioningModel,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy