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

com.pulumi.gcp.compute.kotlin.inputs.InstanceFromTemplateSchedulingArgs.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.20.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.InstanceFromTemplateSchedulingArgs.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 if the instance should be restarted if it was terminated by Compute Engine (not a user).
 * @property hostErrorTimeoutSeconds Specify 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 Specifies the action GCE should take when SPOT VM is preempted.
 * @property localSsdRecoveryTimeout 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 timeout for new network connections to hosts.
 * @property minNodeCpus
 * @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.
 * @property onHostMaintenance Describes maintenance behavior for the instance. One of MIGRATE or TERMINATE,
 * @property onInstanceStopAction Defines the behaviour for instances with the instance_termination_action.
 * @property preemptible Whether the instance is preemptible.
 * @property provisioningModel Whether the instance is spot. If this is set as SPOT.
 */
public data class InstanceFromTemplateSchedulingArgs(
    public val automaticRestart: Output? = null,
    public val hostErrorTimeoutSeconds: Output? = null,
    public val instanceTerminationAction: Output? = null,
    public val localSsdRecoveryTimeout: 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.InstanceFromTemplateSchedulingArgs =
        com.pulumi.gcp.compute.inputs.InstanceFromTemplateSchedulingArgs.builder()
            .automaticRestart(automaticRestart?.applyValue({ args0 -> args0 }))
            .hostErrorTimeoutSeconds(hostErrorTimeoutSeconds?.applyValue({ args0 -> args0 }))
            .instanceTerminationAction(instanceTerminationAction?.applyValue({ args0 -> args0 }))
            .localSsdRecoveryTimeout(
                localSsdRecoveryTimeout?.applyValue({ 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 [InstanceFromTemplateSchedulingArgs].
 */
@PulumiTagMarker
public class InstanceFromTemplateSchedulingArgsBuilder internal constructor() {
    private var automaticRestart: Output? = null

    private var hostErrorTimeoutSeconds: Output? = null

    private var instanceTerminationAction: Output? = null

    private var localSsdRecoveryTimeout:
        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 if the instance should be restarted if it was terminated by Compute Engine (not a user).
     */
    @JvmName("ndoqeemjanjjogsa")
    public suspend fun automaticRestart(`value`: Output) {
        this.automaticRestart = value
    }

    /**
     * @param value Specify 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("xrotmnjjbtdpbwrk")
    public suspend fun hostErrorTimeoutSeconds(`value`: Output) {
        this.hostErrorTimeoutSeconds = value
    }

    /**
     * @param value Specifies the action GCE should take when SPOT VM is preempted.
     */
    @JvmName("kdxykbtoqenbdxcb")
    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("plsrbhfdjxddmeeg")
    public suspend fun localSsdRecoveryTimeout(`value`: Output) {
        this.localSsdRecoveryTimeout = value
    }

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

    /**
     * @param value The timeout for new network connections to hosts.
     */
    @JvmName("owwmknsyhfglvlnx")
    public suspend fun maxRunDuration(`value`: Output) {
        this.maxRunDuration = value
    }

    /**
     * @param value
     */
    @JvmName("fwndxnbkrfikuqco")
    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.
     */
    @JvmName("quflywykvdhosnjt")
    public suspend fun nodeAffinities(`value`: Output>) {
        this.nodeAffinities = value
    }

    @JvmName("yuutpdbfewvycddt")
    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.
     */
    @JvmName("asvieoeldyyaxywu")
    public suspend fun nodeAffinities(values: List>) {
        this.nodeAffinities = Output.all(values)
    }

    /**
     * @param value Describes maintenance behavior for the instance. One of MIGRATE or TERMINATE,
     */
    @JvmName("dewwqdsnlqipmnpn")
    public suspend fun onHostMaintenance(`value`: Output) {
        this.onHostMaintenance = value
    }

    /**
     * @param value Defines the behaviour for instances with the instance_termination_action.
     */
    @JvmName("qddbhtfwyqyxniup")
    public suspend fun onInstanceStopAction(`value`: Output) {
        this.onInstanceStopAction = value
    }

    /**
     * @param value Whether the instance is preemptible.
     */
    @JvmName("wodsvfchaenffhou")
    public suspend fun preemptible(`value`: Output) {
        this.preemptible = value
    }

    /**
     * @param value Whether the instance is spot. If this is set as SPOT.
     */
    @JvmName("luldpotephlahipl")
    public suspend fun provisioningModel(`value`: Output) {
        this.provisioningModel = value
    }

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

    /**
     * @param value Specify 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("kmsykvjejcxtwkrc")
    public suspend fun hostErrorTimeoutSeconds(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.hostErrorTimeoutSeconds = mapped
    }

    /**
     * @param value Specifies the action GCE should take when SPOT VM is preempted.
     */
    @JvmName("nxxsveocugrsvxfq")
    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("cpxkiliixxorqwkw")
    public suspend fun localSsdRecoveryTimeout(`value`: InstanceFromTemplateSchedulingLocalSsdRecoveryTimeoutArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.localSsdRecoveryTimeout = 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("tcuvunnwitgbwfmk")
    public suspend fun localSsdRecoveryTimeout(argument: suspend InstanceFromTemplateSchedulingLocalSsdRecoveryTimeoutArgsBuilder.() -> Unit) {
        val toBeMapped =
            InstanceFromTemplateSchedulingLocalSsdRecoveryTimeoutArgsBuilder().applySuspend {
                argument()
            }.build()
        val mapped = of(toBeMapped)
        this.localSsdRecoveryTimeout = mapped
    }

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

    /**
     * @param value The timeout for new network connections to hosts.
     */
    @JvmName("dyuduybolxigedda")
    public suspend fun maxRunDuration(`value`: InstanceFromTemplateSchedulingMaxRunDurationArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.maxRunDuration = mapped
    }

    /**
     * @param argument The timeout for new network connections to hosts.
     */
    @JvmName("dgqpnfvfcbyatlqx")
    public suspend fun maxRunDuration(argument: suspend InstanceFromTemplateSchedulingMaxRunDurationArgsBuilder.() -> Unit) {
        val toBeMapped = InstanceFromTemplateSchedulingMaxRunDurationArgsBuilder().applySuspend {
            argument()
        }.build()
        val mapped = of(toBeMapped)
        this.maxRunDuration = mapped
    }

    /**
     * @param value
     */
    @JvmName("jjegjgvycqsjdvha")
    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.
     */
    @JvmName("jgtjoxkmhlqtapkw")
    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.
     */
    @JvmName("lurcroukcalstesw")
    public suspend fun nodeAffinities(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            InstanceFromTemplateSchedulingNodeAffinityArgsBuilder().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.
     */
    @JvmName("osffkhamcrhrglba")
    public suspend fun nodeAffinities(vararg argument: suspend InstanceFromTemplateSchedulingNodeAffinityArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            InstanceFromTemplateSchedulingNodeAffinityArgsBuilder().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.
     */
    @JvmName("ufiuohlhnohvyuxo")
    public suspend fun nodeAffinities(argument: suspend InstanceFromTemplateSchedulingNodeAffinityArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(
            InstanceFromTemplateSchedulingNodeAffinityArgsBuilder().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.
     */
    @JvmName("ekgkbeibryguplcx")
    public suspend fun nodeAffinities(vararg values: InstanceFromTemplateSchedulingNodeAffinityArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.nodeAffinities = mapped
    }

    /**
     * @param value Describes maintenance behavior for the instance. One of MIGRATE or TERMINATE,
     */
    @JvmName("dylkphkyowhbyehq")
    public suspend fun onHostMaintenance(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.onHostMaintenance = mapped
    }

    /**
     * @param value Defines the behaviour for instances with the instance_termination_action.
     */
    @JvmName("cybhtipfeuxcnxqg")
    public suspend fun onInstanceStopAction(`value`: InstanceFromTemplateSchedulingOnInstanceStopActionArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.onInstanceStopAction = mapped
    }

    /**
     * @param argument Defines the behaviour for instances with the instance_termination_action.
     */
    @JvmName("ndpdegcdkkoayauh")
    public suspend fun onInstanceStopAction(argument: suspend InstanceFromTemplateSchedulingOnInstanceStopActionArgsBuilder.() -> Unit) {
        val toBeMapped = InstanceFromTemplateSchedulingOnInstanceStopActionArgsBuilder().applySuspend {
            argument()
        }.build()
        val mapped = of(toBeMapped)
        this.onInstanceStopAction = mapped
    }

    /**
     * @param value Whether the instance is preemptible.
     */
    @JvmName("ayjnksrkqedmtiqh")
    public suspend fun preemptible(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.preemptible = mapped
    }

    /**
     * @param value Whether the instance is spot. If this is set as SPOT.
     */
    @JvmName("tlbtwwhcvbxywbij")
    public suspend fun provisioningModel(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.provisioningModel = mapped
    }

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy