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

com.pulumi.azure.compute.kotlin.inputs.LinuxVirtualMachineOsDiskArgs.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: 6.15.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.azure.compute.kotlin.inputs

import com.pulumi.azure.compute.inputs.LinuxVirtualMachineOsDiskArgs.builder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiNullFieldException
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.jvm.JvmName

/**
 *
 * @property caching The Type of Caching which should be used for the Internal OS Disk. Possible values are `None`, `ReadOnly` and `ReadWrite`.
 * @property diffDiskSettings A `diff_disk_settings` block as defined above. Changing this forces a new resource to be created.
 * > **NOTE:** `diff_disk_settings` can only be set when `caching` is set to `ReadOnly`. More information can be found [here](https://docs.microsoft.com/azure/virtual-machines/ephemeral-os-disks-deploy#vm-template-deployment)
 * @property diskEncryptionSetId The ID of the Disk Encryption Set which should be used to Encrypt this OS Disk. Conflicts with `secure_vm_disk_encryption_set_id`.
 * > **NOTE:** The Disk Encryption Set must have the `Reader` Role Assignment scoped on the Key Vault - in addition to an Access Policy to the Key Vault
 * @property diskSizeGb The Size of the Internal OS Disk in GB, if you wish to vary from the size used in the image this Virtual Machine is sourced from.
 * > **NOTE:** If specified this must be equal to or larger than the size of the Image the Virtual Machine is based on. When creating a larger disk than exists in the image you'll need to repartition the disk to use the remaining space.
 * @property name The name which should be used for the Internal OS Disk. Changing this forces a new resource to be created.
 * @property secureVmDiskEncryptionSetId The ID of the Disk Encryption Set which should be used to Encrypt this OS Disk when the Virtual Machine is a Confidential VM. Conflicts with `disk_encryption_set_id`. Changing this forces a new resource to be created.
 * > **NOTE:** `secure_vm_disk_encryption_set_id` can only be specified when `security_encryption_type` is set to `DiskWithVMGuestState`.
 * @property securityEncryptionType Encryption Type when the Virtual Machine is a Confidential VM. Possible values are `VMGuestStateOnly` and `DiskWithVMGuestState`. Changing this forces a new resource to be created.
 * > **NOTE:** `vtpm_enabled` must be set to `true` when `security_encryption_type` is specified.
 * > **NOTE:** `encryption_at_host_enabled` cannot be set to `true` when `security_encryption_type` is set to `DiskWithVMGuestState`.
 * @property storageAccountType The Type of Storage Account which should back this the Internal OS Disk. Possible values are `Standard_LRS`, `StandardSSD_LRS`, `Premium_LRS`, `StandardSSD_ZRS` and `Premium_ZRS`. Changing this forces a new resource to be created.
 * @property writeAcceleratorEnabled Should Write Accelerator be Enabled for this OS Disk? Defaults to `false`.
 * > **NOTE:** This requires that the `storage_account_type` is set to `Premium_LRS` and that `caching` is set to `None`.
 */
public data class LinuxVirtualMachineOsDiskArgs(
    public val caching: Output,
    public val diffDiskSettings: Output? = null,
    public val diskEncryptionSetId: Output? = null,
    public val diskSizeGb: Output? = null,
    public val name: Output? = null,
    public val secureVmDiskEncryptionSetId: Output? = null,
    public val securityEncryptionType: Output? = null,
    public val storageAccountType: Output,
    public val writeAcceleratorEnabled: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azure.compute.inputs.LinuxVirtualMachineOsDiskArgs =
        com.pulumi.azure.compute.inputs.LinuxVirtualMachineOsDiskArgs.builder()
            .caching(caching.applyValue({ args0 -> args0 }))
            .diffDiskSettings(diffDiskSettings?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .diskEncryptionSetId(diskEncryptionSetId?.applyValue({ args0 -> args0 }))
            .diskSizeGb(diskSizeGb?.applyValue({ args0 -> args0 }))
            .name(name?.applyValue({ args0 -> args0 }))
            .secureVmDiskEncryptionSetId(secureVmDiskEncryptionSetId?.applyValue({ args0 -> args0 }))
            .securityEncryptionType(securityEncryptionType?.applyValue({ args0 -> args0 }))
            .storageAccountType(storageAccountType.applyValue({ args0 -> args0 }))
            .writeAcceleratorEnabled(writeAcceleratorEnabled?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [LinuxVirtualMachineOsDiskArgs].
 */
@PulumiTagMarker
public class LinuxVirtualMachineOsDiskArgsBuilder internal constructor() {
    private var caching: Output? = null

    private var diffDiskSettings: Output? = null

    private var diskEncryptionSetId: Output? = null

    private var diskSizeGb: Output? = null

    private var name: Output? = null

    private var secureVmDiskEncryptionSetId: Output? = null

    private var securityEncryptionType: Output? = null

    private var storageAccountType: Output? = null

    private var writeAcceleratorEnabled: Output? = null

    /**
     * @param value The Type of Caching which should be used for the Internal OS Disk. Possible values are `None`, `ReadOnly` and `ReadWrite`.
     */
    @JvmName("nwvdwiprgculhmwb")
    public suspend fun caching(`value`: Output) {
        this.caching = value
    }

    /**
     * @param value A `diff_disk_settings` block as defined above. Changing this forces a new resource to be created.
     * > **NOTE:** `diff_disk_settings` can only be set when `caching` is set to `ReadOnly`. More information can be found [here](https://docs.microsoft.com/azure/virtual-machines/ephemeral-os-disks-deploy#vm-template-deployment)
     */
    @JvmName("jbolyqnljjmrfhlb")
    public suspend fun diffDiskSettings(`value`: Output) {
        this.diffDiskSettings = value
    }

    /**
     * @param value The ID of the Disk Encryption Set which should be used to Encrypt this OS Disk. Conflicts with `secure_vm_disk_encryption_set_id`.
     * > **NOTE:** The Disk Encryption Set must have the `Reader` Role Assignment scoped on the Key Vault - in addition to an Access Policy to the Key Vault
     */
    @JvmName("ybrutmlmejbetmsn")
    public suspend fun diskEncryptionSetId(`value`: Output) {
        this.diskEncryptionSetId = value
    }

    /**
     * @param value The Size of the Internal OS Disk in GB, if you wish to vary from the size used in the image this Virtual Machine is sourced from.
     * > **NOTE:** If specified this must be equal to or larger than the size of the Image the Virtual Machine is based on. When creating a larger disk than exists in the image you'll need to repartition the disk to use the remaining space.
     */
    @JvmName("yjqsxuovqefqnari")
    public suspend fun diskSizeGb(`value`: Output) {
        this.diskSizeGb = value
    }

    /**
     * @param value The name which should be used for the Internal OS Disk. Changing this forces a new resource to be created.
     */
    @JvmName("pickkjyonculwgxp")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value The ID of the Disk Encryption Set which should be used to Encrypt this OS Disk when the Virtual Machine is a Confidential VM. Conflicts with `disk_encryption_set_id`. Changing this forces a new resource to be created.
     * > **NOTE:** `secure_vm_disk_encryption_set_id` can only be specified when `security_encryption_type` is set to `DiskWithVMGuestState`.
     */
    @JvmName("qwigfgvioqhmrbky")
    public suspend fun secureVmDiskEncryptionSetId(`value`: Output) {
        this.secureVmDiskEncryptionSetId = value
    }

    /**
     * @param value Encryption Type when the Virtual Machine is a Confidential VM. Possible values are `VMGuestStateOnly` and `DiskWithVMGuestState`. Changing this forces a new resource to be created.
     * > **NOTE:** `vtpm_enabled` must be set to `true` when `security_encryption_type` is specified.
     * > **NOTE:** `encryption_at_host_enabled` cannot be set to `true` when `security_encryption_type` is set to `DiskWithVMGuestState`.
     */
    @JvmName("scgdjawlycvjqrcl")
    public suspend fun securityEncryptionType(`value`: Output) {
        this.securityEncryptionType = value
    }

    /**
     * @param value The Type of Storage Account which should back this the Internal OS Disk. Possible values are `Standard_LRS`, `StandardSSD_LRS`, `Premium_LRS`, `StandardSSD_ZRS` and `Premium_ZRS`. Changing this forces a new resource to be created.
     */
    @JvmName("shunrmsslbkyiqci")
    public suspend fun storageAccountType(`value`: Output) {
        this.storageAccountType = value
    }

    /**
     * @param value Should Write Accelerator be Enabled for this OS Disk? Defaults to `false`.
     * > **NOTE:** This requires that the `storage_account_type` is set to `Premium_LRS` and that `caching` is set to `None`.
     */
    @JvmName("ueaktdjuildyarvl")
    public suspend fun writeAcceleratorEnabled(`value`: Output) {
        this.writeAcceleratorEnabled = value
    }

    /**
     * @param value The Type of Caching which should be used for the Internal OS Disk. Possible values are `None`, `ReadOnly` and `ReadWrite`.
     */
    @JvmName("hdlvyrjqbcnyoaaa")
    public suspend fun caching(`value`: String) {
        val toBeMapped = value
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.caching = mapped
    }

    /**
     * @param value A `diff_disk_settings` block as defined above. Changing this forces a new resource to be created.
     * > **NOTE:** `diff_disk_settings` can only be set when `caching` is set to `ReadOnly`. More information can be found [here](https://docs.microsoft.com/azure/virtual-machines/ephemeral-os-disks-deploy#vm-template-deployment)
     */
    @JvmName("kgykgrjlorpkwlqv")
    public suspend fun diffDiskSettings(`value`: LinuxVirtualMachineOsDiskDiffDiskSettingsArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.diffDiskSettings = mapped
    }

    /**
     * @param argument A `diff_disk_settings` block as defined above. Changing this forces a new resource to be created.
     * > **NOTE:** `diff_disk_settings` can only be set when `caching` is set to `ReadOnly`. More information can be found [here](https://docs.microsoft.com/azure/virtual-machines/ephemeral-os-disks-deploy#vm-template-deployment)
     */
    @JvmName("nnbgcuqsoppwvlir")
    public suspend fun diffDiskSettings(argument: suspend LinuxVirtualMachineOsDiskDiffDiskSettingsArgsBuilder.() -> Unit) {
        val toBeMapped = LinuxVirtualMachineOsDiskDiffDiskSettingsArgsBuilder().applySuspend {
            argument()
        }.build()
        val mapped = of(toBeMapped)
        this.diffDiskSettings = mapped
    }

    /**
     * @param value The ID of the Disk Encryption Set which should be used to Encrypt this OS Disk. Conflicts with `secure_vm_disk_encryption_set_id`.
     * > **NOTE:** The Disk Encryption Set must have the `Reader` Role Assignment scoped on the Key Vault - in addition to an Access Policy to the Key Vault
     */
    @JvmName("lhcaongykxofpbyc")
    public suspend fun diskEncryptionSetId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.diskEncryptionSetId = mapped
    }

    /**
     * @param value The Size of the Internal OS Disk in GB, if you wish to vary from the size used in the image this Virtual Machine is sourced from.
     * > **NOTE:** If specified this must be equal to or larger than the size of the Image the Virtual Machine is based on. When creating a larger disk than exists in the image you'll need to repartition the disk to use the remaining space.
     */
    @JvmName("achokfrklgkvhcnr")
    public suspend fun diskSizeGb(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.diskSizeGb = mapped
    }

    /**
     * @param value The name which should be used for the Internal OS Disk. Changing this forces a new resource to be created.
     */
    @JvmName("cxwgvefytioywkop")
    public suspend fun name(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.name = mapped
    }

    /**
     * @param value The ID of the Disk Encryption Set which should be used to Encrypt this OS Disk when the Virtual Machine is a Confidential VM. Conflicts with `disk_encryption_set_id`. Changing this forces a new resource to be created.
     * > **NOTE:** `secure_vm_disk_encryption_set_id` can only be specified when `security_encryption_type` is set to `DiskWithVMGuestState`.
     */
    @JvmName("hnstsphpqonfuoxy")
    public suspend fun secureVmDiskEncryptionSetId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.secureVmDiskEncryptionSetId = mapped
    }

    /**
     * @param value Encryption Type when the Virtual Machine is a Confidential VM. Possible values are `VMGuestStateOnly` and `DiskWithVMGuestState`. Changing this forces a new resource to be created.
     * > **NOTE:** `vtpm_enabled` must be set to `true` when `security_encryption_type` is specified.
     * > **NOTE:** `encryption_at_host_enabled` cannot be set to `true` when `security_encryption_type` is set to `DiskWithVMGuestState`.
     */
    @JvmName("syoxbqjjlaelcoxl")
    public suspend fun securityEncryptionType(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.securityEncryptionType = mapped
    }

    /**
     * @param value The Type of Storage Account which should back this the Internal OS Disk. Possible values are `Standard_LRS`, `StandardSSD_LRS`, `Premium_LRS`, `StandardSSD_ZRS` and `Premium_ZRS`. Changing this forces a new resource to be created.
     */
    @JvmName("yuapsxvnhbwvgtkr")
    public suspend fun storageAccountType(`value`: String) {
        val toBeMapped = value
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.storageAccountType = mapped
    }

    /**
     * @param value Should Write Accelerator be Enabled for this OS Disk? Defaults to `false`.
     * > **NOTE:** This requires that the `storage_account_type` is set to `Premium_LRS` and that `caching` is set to `None`.
     */
    @JvmName("fgnqsvgmxrpkrdyx")
    public suspend fun writeAcceleratorEnabled(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.writeAcceleratorEnabled = mapped
    }

    internal fun build(): LinuxVirtualMachineOsDiskArgs = LinuxVirtualMachineOsDiskArgs(
        caching = caching ?: throw PulumiNullFieldException("caching"),
        diffDiskSettings = diffDiskSettings,
        diskEncryptionSetId = diskEncryptionSetId,
        diskSizeGb = diskSizeGb,
        name = name,
        secureVmDiskEncryptionSetId = secureVmDiskEncryptionSetId,
        securityEncryptionType = securityEncryptionType,
        storageAccountType = storageAccountType ?: throw PulumiNullFieldException("storageAccountType"),
        writeAcceleratorEnabled = writeAcceleratorEnabled,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy