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

com.pulumi.googlenative.batch.v1.kotlin.inputs.InstancePolicyArgs.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.

The newest version!
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.googlenative.batch.v1.kotlin.inputs

import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.googlenative.batch.v1.inputs.InstancePolicyArgs.builder
import com.pulumi.googlenative.batch.v1.kotlin.enums.InstancePolicyProvisioningModel
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.jvm.JvmName

/**
 * InstancePolicy describes an instance type and resources attached to each VM created by this InstancePolicy.
 * @property accelerators The accelerators attached to each VM instance.
 * @property bootDisk Boot disk to be created and attached to each VM by this InstancePolicy. Boot disk will be deleted when the VM is deleted. Batch API now only supports booting from image.
 * @property disks Non-boot disks to be attached for each VM created by this InstancePolicy. New disks will be deleted when the VM is deleted.
 * @property machineType The Compute Engine machine type.
 * @property minCpuPlatform The minimum CPU platform. See https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform. Not yet implemented.
 * @property provisioningModel The provisioning model.
 */
public data class InstancePolicyArgs(
    public val accelerators: Output>? = null,
    public val bootDisk: Output? = null,
    public val disks: Output>? = null,
    public val machineType: Output? = null,
    public val minCpuPlatform: Output? = null,
    public val provisioningModel: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.googlenative.batch.v1.inputs.InstancePolicyArgs =
        com.pulumi.googlenative.batch.v1.inputs.InstancePolicyArgs.builder()
            .accelerators(
                accelerators?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            )
            .bootDisk(bootDisk?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .disks(disks?.applyValue({ args0 -> args0.map({ args0 -> args0.let({ args0 -> args0.toJava() }) }) }))
            .machineType(machineType?.applyValue({ args0 -> args0 }))
            .minCpuPlatform(minCpuPlatform?.applyValue({ args0 -> args0 }))
            .provisioningModel(
                provisioningModel?.applyValue({ args0 ->
                    args0.let({ args0 ->
                        args0.toJava()
                    })
                }),
            ).build()
}

/**
 * Builder for [InstancePolicyArgs].
 */
@PulumiTagMarker
public class InstancePolicyArgsBuilder internal constructor() {
    private var accelerators: Output>? = null

    private var bootDisk: Output? = null

    private var disks: Output>? = null

    private var machineType: Output? = null

    private var minCpuPlatform: Output? = null

    private var provisioningModel: Output? = null

    /**
     * @param value The accelerators attached to each VM instance.
     */
    @JvmName("hegvvhqjbqerrosh")
    public suspend fun accelerators(`value`: Output>) {
        this.accelerators = value
    }

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

    /**
     * @param values The accelerators attached to each VM instance.
     */
    @JvmName("jxgtiyyhbppmswcs")
    public suspend fun accelerators(values: List>) {
        this.accelerators = Output.all(values)
    }

    /**
     * @param value Boot disk to be created and attached to each VM by this InstancePolicy. Boot disk will be deleted when the VM is deleted. Batch API now only supports booting from image.
     */
    @JvmName("jpktnkvdjrijqenu")
    public suspend fun bootDisk(`value`: Output) {
        this.bootDisk = value
    }

    /**
     * @param value Non-boot disks to be attached for each VM created by this InstancePolicy. New disks will be deleted when the VM is deleted.
     */
    @JvmName("uohrdtnkqddhcidl")
    public suspend fun disks(`value`: Output>) {
        this.disks = value
    }

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

    /**
     * @param values Non-boot disks to be attached for each VM created by this InstancePolicy. New disks will be deleted when the VM is deleted.
     */
    @JvmName("fhfjtdqlmolafqmx")
    public suspend fun disks(values: List>) {
        this.disks = Output.all(values)
    }

    /**
     * @param value The Compute Engine machine type.
     */
    @JvmName("qfkwshbuiukowbox")
    public suspend fun machineType(`value`: Output) {
        this.machineType = value
    }

    /**
     * @param value The minimum CPU platform. See https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform. Not yet implemented.
     */
    @JvmName("gbkvupvmnfulytyu")
    public suspend fun minCpuPlatform(`value`: Output) {
        this.minCpuPlatform = value
    }

    /**
     * @param value The provisioning model.
     */
    @JvmName("xdohkknkfyruhtxn")
    public suspend fun provisioningModel(`value`: Output) {
        this.provisioningModel = value
    }

    /**
     * @param value The accelerators attached to each VM instance.
     */
    @JvmName("hrusdxvhufjiiuod")
    public suspend fun accelerators(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.accelerators = mapped
    }

    /**
     * @param argument The accelerators attached to each VM instance.
     */
    @JvmName("fubhhcjshtepyaxo")
    public suspend fun accelerators(argument: List Unit>) {
        val toBeMapped = argument.toList().map { AcceleratorArgsBuilder().applySuspend { it() }.build() }
        val mapped = of(toBeMapped)
        this.accelerators = mapped
    }

    /**
     * @param argument The accelerators attached to each VM instance.
     */
    @JvmName("rjewwcqpkxjcwjdo")
    public suspend fun accelerators(vararg argument: suspend AcceleratorArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map { AcceleratorArgsBuilder().applySuspend { it() }.build() }
        val mapped = of(toBeMapped)
        this.accelerators = mapped
    }

    /**
     * @param argument The accelerators attached to each VM instance.
     */
    @JvmName("hnsggkucdwqkvnyu")
    public suspend fun accelerators(argument: suspend AcceleratorArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(AcceleratorArgsBuilder().applySuspend { argument() }.build())
        val mapped = of(toBeMapped)
        this.accelerators = mapped
    }

    /**
     * @param values The accelerators attached to each VM instance.
     */
    @JvmName("fcdpugcmlhfcfggm")
    public suspend fun accelerators(vararg values: AcceleratorArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.accelerators = mapped
    }

    /**
     * @param value Boot disk to be created and attached to each VM by this InstancePolicy. Boot disk will be deleted when the VM is deleted. Batch API now only supports booting from image.
     */
    @JvmName("kgxtjobnttmhwuog")
    public suspend fun bootDisk(`value`: DiskArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.bootDisk = mapped
    }

    /**
     * @param argument Boot disk to be created and attached to each VM by this InstancePolicy. Boot disk will be deleted when the VM is deleted. Batch API now only supports booting from image.
     */
    @JvmName("vbqlkerrnsmcrwmg")
    public suspend fun bootDisk(argument: suspend DiskArgsBuilder.() -> Unit) {
        val toBeMapped = DiskArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.bootDisk = mapped
    }

    /**
     * @param value Non-boot disks to be attached for each VM created by this InstancePolicy. New disks will be deleted when the VM is deleted.
     */
    @JvmName("qnwxjrvybmekohff")
    public suspend fun disks(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.disks = mapped
    }

    /**
     * @param argument Non-boot disks to be attached for each VM created by this InstancePolicy. New disks will be deleted when the VM is deleted.
     */
    @JvmName("ynmrcdllahopkqjy")
    public suspend fun disks(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            AttachedDiskArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.disks = mapped
    }

    /**
     * @param argument Non-boot disks to be attached for each VM created by this InstancePolicy. New disks will be deleted when the VM is deleted.
     */
    @JvmName("xtcrnjxcdaiyraxa")
    public suspend fun disks(vararg argument: suspend AttachedDiskArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            AttachedDiskArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.disks = mapped
    }

    /**
     * @param argument Non-boot disks to be attached for each VM created by this InstancePolicy. New disks will be deleted when the VM is deleted.
     */
    @JvmName("lettvhcnesdsnyou")
    public suspend fun disks(argument: suspend AttachedDiskArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(AttachedDiskArgsBuilder().applySuspend { argument() }.build())
        val mapped = of(toBeMapped)
        this.disks = mapped
    }

    /**
     * @param values Non-boot disks to be attached for each VM created by this InstancePolicy. New disks will be deleted when the VM is deleted.
     */
    @JvmName("yicwsldbnsxsgkmg")
    public suspend fun disks(vararg values: AttachedDiskArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.disks = mapped
    }

    /**
     * @param value The Compute Engine machine type.
     */
    @JvmName("mmuddpukygepbjpr")
    public suspend fun machineType(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.machineType = mapped
    }

    /**
     * @param value The minimum CPU platform. See https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform. Not yet implemented.
     */
    @JvmName("iyrsymyhtwckaamr")
    public suspend fun minCpuPlatform(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.minCpuPlatform = mapped
    }

    /**
     * @param value The provisioning model.
     */
    @JvmName("yncihmqptylwuqrj")
    public suspend fun provisioningModel(`value`: InstancePolicyProvisioningModel?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.provisioningModel = mapped
    }

    internal fun build(): InstancePolicyArgs = InstancePolicyArgs(
        accelerators = accelerators,
        bootDisk = bootDisk,
        disks = disks,
        machineType = machineType,
        minCpuPlatform = minCpuPlatform,
        provisioningModel = provisioningModel,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy