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

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

package com.pulumi.gcp.cloudrunv2.kotlin.inputs

import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.gcp.cloudrunv2.inputs.ServiceTemplateContainerResourcesArgs.builder
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.Boolean
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.collections.Map
import kotlin.jvm.JvmName

/**
 *
 * @property cpuIdle Determines whether CPU is only allocated during requests. True by default if the parent `resources` field is not set. However, if
 * `resources` is set, this field must be explicitly set to true to preserve the default behavior.
 * @property limits Only memory and CPU are supported. Use key `cpu` for CPU limit and `memory` for memory limit. Note: The only supported values for CPU are '1', '2', '4', and '8'. Setting 4 CPU requires at least 2Gi of memory. The values of the map is string form of the 'quantity' k8s type: https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/apimachinery/pkg/api/resource/quantity.go
 * @property startupCpuBoost Determines whether CPU should be boosted on startup of a new container instance above the requested CPU threshold, this can help reduce cold-start latency.
 */
public data class ServiceTemplateContainerResourcesArgs(
    public val cpuIdle: Output? = null,
    public val limits: Output>? = null,
    public val startupCpuBoost: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.gcp.cloudrunv2.inputs.ServiceTemplateContainerResourcesArgs =
        com.pulumi.gcp.cloudrunv2.inputs.ServiceTemplateContainerResourcesArgs.builder()
            .cpuIdle(cpuIdle?.applyValue({ args0 -> args0 }))
            .limits(limits?.applyValue({ args0 -> args0.map({ args0 -> args0.key.to(args0.value) }).toMap() }))
            .startupCpuBoost(startupCpuBoost?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [ServiceTemplateContainerResourcesArgs].
 */
@PulumiTagMarker
public class ServiceTemplateContainerResourcesArgsBuilder internal constructor() {
    private var cpuIdle: Output? = null

    private var limits: Output>? = null

    private var startupCpuBoost: Output? = null

    /**
     * @param value Determines whether CPU is only allocated during requests. True by default if the parent `resources` field is not set. However, if
     * `resources` is set, this field must be explicitly set to true to preserve the default behavior.
     */
    @JvmName("ilisyggkqfxmdfke")
    public suspend fun cpuIdle(`value`: Output) {
        this.cpuIdle = value
    }

    /**
     * @param value Only memory and CPU are supported. Use key `cpu` for CPU limit and `memory` for memory limit. Note: The only supported values for CPU are '1', '2', '4', and '8'. Setting 4 CPU requires at least 2Gi of memory. The values of the map is string form of the 'quantity' k8s type: https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/apimachinery/pkg/api/resource/quantity.go
     */
    @JvmName("hgpiuvuavjbruftg")
    public suspend fun limits(`value`: Output>) {
        this.limits = value
    }

    /**
     * @param value Determines whether CPU should be boosted on startup of a new container instance above the requested CPU threshold, this can help reduce cold-start latency.
     */
    @JvmName("mbbbmiyxqgkgxbre")
    public suspend fun startupCpuBoost(`value`: Output) {
        this.startupCpuBoost = value
    }

    /**
     * @param value Determines whether CPU is only allocated during requests. True by default if the parent `resources` field is not set. However, if
     * `resources` is set, this field must be explicitly set to true to preserve the default behavior.
     */
    @JvmName("umouasqlwxlslxjv")
    public suspend fun cpuIdle(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.cpuIdle = mapped
    }

    /**
     * @param value Only memory and CPU are supported. Use key `cpu` for CPU limit and `memory` for memory limit. Note: The only supported values for CPU are '1', '2', '4', and '8'. Setting 4 CPU requires at least 2Gi of memory. The values of the map is string form of the 'quantity' k8s type: https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/apimachinery/pkg/api/resource/quantity.go
     */
    @JvmName("wwaliantfrqoyohc")
    public suspend fun limits(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.limits = mapped
    }

    /**
     * @param values Only memory and CPU are supported. Use key `cpu` for CPU limit and `memory` for memory limit. Note: The only supported values for CPU are '1', '2', '4', and '8'. Setting 4 CPU requires at least 2Gi of memory. The values of the map is string form of the 'quantity' k8s type: https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/apimachinery/pkg/api/resource/quantity.go
     */
    @JvmName("gbkaubdrssuijtqw")
    public fun limits(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.limits = mapped
    }

    /**
     * @param value Determines whether CPU should be boosted on startup of a new container instance above the requested CPU threshold, this can help reduce cold-start latency.
     */
    @JvmName("ixigrvbskmhkadue")
    public suspend fun startupCpuBoost(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.startupCpuBoost = mapped
    }

    internal fun build(): ServiceTemplateContainerResourcesArgs =
        ServiceTemplateContainerResourcesArgs(
            cpuIdle = cpuIdle,
            limits = limits,
            startupCpuBoost = startupCpuBoost,
        )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy