![JAR search and dependency download from the Maven repository](/logo.png)
com.pulumi.azurenative.compute.kotlin.inputs.OSDiskArgs.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-azure-native-kotlin Show documentation
Show all versions of pulumi-azure-native-kotlin Show documentation
Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.azurenative.compute.kotlin.inputs
import com.pulumi.azurenative.compute.inputs.OSDiskArgs.builder
import com.pulumi.azurenative.compute.kotlin.enums.CachingTypes
import com.pulumi.azurenative.compute.kotlin.enums.DiskCreateOptionTypes
import com.pulumi.azurenative.compute.kotlin.enums.DiskDeleteOptionTypes
import com.pulumi.azurenative.compute.kotlin.enums.OperatingSystemTypes
import com.pulumi.core.Either
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
/**
* Specifies information about the operating system disk used by the virtual machine. For more information about disks, see [About disks and VHDs for Azure virtual machines](https://docs.microsoft.com/azure/virtual-machines/managed-disks-overview).
* @property caching Specifies the caching requirements. Possible values are: **None,** **ReadOnly,** **ReadWrite.** The defaulting behavior is: **None for Standard storage. ReadOnly for Premium storage.**
* @property createOption Specifies how the virtual machine should be created. Possible values are: **Attach.** This value is used when you are using a specialized disk to create the virtual machine. **FromImage.** This value is used when you are using an image to create the virtual machine. If you are using a platform image, you should also use the imageReference element described above. If you are using a marketplace image, you should also use the plan element previously described.
* @property deleteOption Specifies whether OS Disk should be deleted or detached upon VM deletion. Possible values are: **Delete.** If this value is used, the OS disk is deleted when VM is deleted. **Detach.** If this value is used, the os disk is retained after VM is deleted. The default value is set to **Detach**. For an ephemeral OS Disk, the default value is set to **Delete**. The user cannot change the delete option for an ephemeral OS Disk.
* @property diffDiskSettings Specifies the ephemeral Disk Settings for the operating system disk used by the virtual machine.
* @property diskSizeGB Specifies the size of an empty data disk in gigabytes. This element can be used to overwrite the size of the disk in a virtual machine image. The property 'diskSizeGB' is the number of bytes x 1024^3 for the disk and the value cannot be larger than 1023.
* @property encryptionSettings Specifies the encryption settings for the OS Disk. Minimum api-version: 2015-06-15.
* @property image The source user image virtual hard disk. The virtual hard disk will be copied before being attached to the virtual machine. If SourceImage is provided, the destination virtual hard drive must not exist.
* @property managedDisk The managed disk parameters.
* @property name The disk name.
* @property osType This property allows you to specify the type of the OS that is included in the disk if creating a VM from user-image or a specialized VHD. Possible values are: **Windows,** **Linux.**
* @property vhd The virtual hard disk.
* @property writeAcceleratorEnabled Specifies whether writeAccelerator should be enabled or disabled on the disk.
*/
public data class OSDiskArgs(
public val caching: Output? = null,
public val createOption: Output>,
public val deleteOption: Output>? = null,
public val diffDiskSettings: Output? = null,
public val diskSizeGB: Output? = null,
public val encryptionSettings: Output? = null,
public val image: Output? = null,
public val managedDisk: Output? = null,
public val name: Output? = null,
public val osType: Output? = null,
public val vhd: Output? = null,
public val writeAcceleratorEnabled: Output? = null,
) : ConvertibleToJava {
override fun toJava(): com.pulumi.azurenative.compute.inputs.OSDiskArgs =
com.pulumi.azurenative.compute.inputs.OSDiskArgs.builder()
.caching(caching?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
.createOption(
createOption.applyValue({ args0 ->
args0.transform({ args0 -> args0 }, { args0 ->
args0.let({ args0 -> args0.toJava() })
})
}),
)
.deleteOption(
deleteOption?.applyValue({ args0 ->
args0.transform({ args0 -> args0 }, { args0 ->
args0.let({ args0 -> args0.toJava() })
})
}),
)
.diffDiskSettings(diffDiskSettings?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
.diskSizeGB(diskSizeGB?.applyValue({ args0 -> args0 }))
.encryptionSettings(
encryptionSettings?.applyValue({ args0 ->
args0.let({ args0 ->
args0.toJava()
})
}),
)
.image(image?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
.managedDisk(managedDisk?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
.name(name?.applyValue({ args0 -> args0 }))
.osType(osType?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
.vhd(vhd?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
.writeAcceleratorEnabled(writeAcceleratorEnabled?.applyValue({ args0 -> args0 })).build()
}
/**
* Builder for [OSDiskArgs].
*/
@PulumiTagMarker
public class OSDiskArgsBuilder internal constructor() {
private var caching: Output? = null
private var createOption: Output>? = null
private var deleteOption: Output>? = null
private var diffDiskSettings: Output? = null
private var diskSizeGB: Output? = null
private var encryptionSettings: Output? = null
private var image: Output? = null
private var managedDisk: Output? = null
private var name: Output? = null
private var osType: Output? = null
private var vhd: Output? = null
private var writeAcceleratorEnabled: Output? = null
/**
* @param value Specifies the caching requirements. Possible values are: **None,** **ReadOnly,** **ReadWrite.** The defaulting behavior is: **None for Standard storage. ReadOnly for Premium storage.**
*/
@JvmName("abpogkbqxbmficvg")
public suspend fun caching(`value`: Output) {
this.caching = value
}
/**
* @param value Specifies how the virtual machine should be created. Possible values are: **Attach.** This value is used when you are using a specialized disk to create the virtual machine. **FromImage.** This value is used when you are using an image to create the virtual machine. If you are using a platform image, you should also use the imageReference element described above. If you are using a marketplace image, you should also use the plan element previously described.
*/
@JvmName("fhspwtiwddbxhxyf")
public suspend fun createOption(`value`: Output>) {
this.createOption = value
}
/**
* @param value Specifies whether OS Disk should be deleted or detached upon VM deletion. Possible values are: **Delete.** If this value is used, the OS disk is deleted when VM is deleted. **Detach.** If this value is used, the os disk is retained after VM is deleted. The default value is set to **Detach**. For an ephemeral OS Disk, the default value is set to **Delete**. The user cannot change the delete option for an ephemeral OS Disk.
*/
@JvmName("ojoetqkefswdmeri")
public suspend fun deleteOption(`value`: Output>) {
this.deleteOption = value
}
/**
* @param value Specifies the ephemeral Disk Settings for the operating system disk used by the virtual machine.
*/
@JvmName("lcoptyqbpupuhyea")
public suspend fun diffDiskSettings(`value`: Output) {
this.diffDiskSettings = value
}
/**
* @param value Specifies the size of an empty data disk in gigabytes. This element can be used to overwrite the size of the disk in a virtual machine image. The property 'diskSizeGB' is the number of bytes x 1024^3 for the disk and the value cannot be larger than 1023.
*/
@JvmName("arsmnkwukiuvimbb")
public suspend fun diskSizeGB(`value`: Output) {
this.diskSizeGB = value
}
/**
* @param value Specifies the encryption settings for the OS Disk. Minimum api-version: 2015-06-15.
*/
@JvmName("goiyjjtvpivmntkl")
public suspend fun encryptionSettings(`value`: Output) {
this.encryptionSettings = value
}
/**
* @param value The source user image virtual hard disk. The virtual hard disk will be copied before being attached to the virtual machine. If SourceImage is provided, the destination virtual hard drive must not exist.
*/
@JvmName("jpgvbjxdcaardmbq")
public suspend fun image(`value`: Output) {
this.image = value
}
/**
* @param value The managed disk parameters.
*/
@JvmName("fblafctvhesijsma")
public suspend fun managedDisk(`value`: Output) {
this.managedDisk = value
}
/**
* @param value The disk name.
*/
@JvmName("kubpdebmqixfqxhm")
public suspend fun name(`value`: Output) {
this.name = value
}
/**
* @param value This property allows you to specify the type of the OS that is included in the disk if creating a VM from user-image or a specialized VHD. Possible values are: **Windows,** **Linux.**
*/
@JvmName("sqojiuwjndpmbivr")
public suspend fun osType(`value`: Output) {
this.osType = value
}
/**
* @param value The virtual hard disk.
*/
@JvmName("pgmbgjnuhfvvicgc")
public suspend fun vhd(`value`: Output) {
this.vhd = value
}
/**
* @param value Specifies whether writeAccelerator should be enabled or disabled on the disk.
*/
@JvmName("ncthrrfkunpkqrcb")
public suspend fun writeAcceleratorEnabled(`value`: Output) {
this.writeAcceleratorEnabled = value
}
/**
* @param value Specifies the caching requirements. Possible values are: **None,** **ReadOnly,** **ReadWrite.** The defaulting behavior is: **None for Standard storage. ReadOnly for Premium storage.**
*/
@JvmName("ihiejmlawbtiuqfm")
public suspend fun caching(`value`: CachingTypes?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.caching = mapped
}
/**
* @param value Specifies how the virtual machine should be created. Possible values are: **Attach.** This value is used when you are using a specialized disk to create the virtual machine. **FromImage.** This value is used when you are using an image to create the virtual machine. If you are using a platform image, you should also use the imageReference element described above. If you are using a marketplace image, you should also use the plan element previously described.
*/
@JvmName("mpmbchfduwurkayb")
public suspend fun createOption(`value`: Either) {
val toBeMapped = value
val mapped = toBeMapped.let({ args0 -> of(args0) })
this.createOption = mapped
}
/**
* @param value Specifies how the virtual machine should be created. Possible values are: **Attach.** This value is used when you are using a specialized disk to create the virtual machine. **FromImage.** This value is used when you are using an image to create the virtual machine. If you are using a platform image, you should also use the imageReference element described above. If you are using a marketplace image, you should also use the plan element previously described.
*/
@JvmName("acxjcfagsyjikdwy")
public fun createOption(`value`: String) {
val toBeMapped = Either.ofLeft(value)
val mapped = toBeMapped.let({ args0 -> of(args0) })
this.createOption = mapped
}
/**
* @param value Specifies how the virtual machine should be created. Possible values are: **Attach.** This value is used when you are using a specialized disk to create the virtual machine. **FromImage.** This value is used when you are using an image to create the virtual machine. If you are using a platform image, you should also use the imageReference element described above. If you are using a marketplace image, you should also use the plan element previously described.
*/
@JvmName("gtjdvsxacphbyexx")
public fun createOption(`value`: DiskCreateOptionTypes) {
val toBeMapped = Either.ofRight(value)
val mapped = toBeMapped.let({ args0 -> of(args0) })
this.createOption = mapped
}
/**
* @param value Specifies whether OS Disk should be deleted or detached upon VM deletion. Possible values are: **Delete.** If this value is used, the OS disk is deleted when VM is deleted. **Detach.** If this value is used, the os disk is retained after VM is deleted. The default value is set to **Detach**. For an ephemeral OS Disk, the default value is set to **Delete**. The user cannot change the delete option for an ephemeral OS Disk.
*/
@JvmName("ddxoihuvrirrjcfu")
public suspend fun deleteOption(`value`: Either?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.deleteOption = mapped
}
/**
* @param value Specifies whether OS Disk should be deleted or detached upon VM deletion. Possible values are: **Delete.** If this value is used, the OS disk is deleted when VM is deleted. **Detach.** If this value is used, the os disk is retained after VM is deleted. The default value is set to **Detach**. For an ephemeral OS Disk, the default value is set to **Delete**. The user cannot change the delete option for an ephemeral OS Disk.
*/
@JvmName("ubyjjhjnlbhoieid")
public fun deleteOption(`value`: String) {
val toBeMapped = Either.ofLeft(value)
val mapped = toBeMapped.let({ args0 -> of(args0) })
this.deleteOption = mapped
}
/**
* @param value Specifies whether OS Disk should be deleted or detached upon VM deletion. Possible values are: **Delete.** If this value is used, the OS disk is deleted when VM is deleted. **Detach.** If this value is used, the os disk is retained after VM is deleted. The default value is set to **Detach**. For an ephemeral OS Disk, the default value is set to **Delete**. The user cannot change the delete option for an ephemeral OS Disk.
*/
@JvmName("oqmbpfetjhgrdnmi")
public fun deleteOption(`value`: DiskDeleteOptionTypes) {
val toBeMapped = Either.ofRight(value)
val mapped = toBeMapped.let({ args0 -> of(args0) })
this.deleteOption = mapped
}
/**
* @param value Specifies the ephemeral Disk Settings for the operating system disk used by the virtual machine.
*/
@JvmName("gqylfronjjsuyyhy")
public suspend fun diffDiskSettings(`value`: DiffDiskSettingsArgs?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.diffDiskSettings = mapped
}
/**
* @param argument Specifies the ephemeral Disk Settings for the operating system disk used by the virtual machine.
*/
@JvmName("cxeatpwrvqsmlgfm")
public suspend fun diffDiskSettings(argument: suspend DiffDiskSettingsArgsBuilder.() -> Unit) {
val toBeMapped = DiffDiskSettingsArgsBuilder().applySuspend { argument() }.build()
val mapped = of(toBeMapped)
this.diffDiskSettings = mapped
}
/**
* @param value Specifies the size of an empty data disk in gigabytes. This element can be used to overwrite the size of the disk in a virtual machine image. The property 'diskSizeGB' is the number of bytes x 1024^3 for the disk and the value cannot be larger than 1023.
*/
@JvmName("dmayjtuwjtgrjydb")
public suspend fun diskSizeGB(`value`: Int?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.diskSizeGB = mapped
}
/**
* @param value Specifies the encryption settings for the OS Disk. Minimum api-version: 2015-06-15.
*/
@JvmName("yjhokmqdahoewbrj")
public suspend fun encryptionSettings(`value`: DiskEncryptionSettingsArgs?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.encryptionSettings = mapped
}
/**
* @param argument Specifies the encryption settings for the OS Disk. Minimum api-version: 2015-06-15.
*/
@JvmName("rddbdgibmkkvaoca")
public suspend fun encryptionSettings(argument: suspend DiskEncryptionSettingsArgsBuilder.() -> Unit) {
val toBeMapped = DiskEncryptionSettingsArgsBuilder().applySuspend { argument() }.build()
val mapped = of(toBeMapped)
this.encryptionSettings = mapped
}
/**
* @param value The source user image virtual hard disk. The virtual hard disk will be copied before being attached to the virtual machine. If SourceImage is provided, the destination virtual hard drive must not exist.
*/
@JvmName("pflvpxjmdrsspbdc")
public suspend fun image(`value`: VirtualHardDiskArgs?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.image = mapped
}
/**
* @param argument The source user image virtual hard disk. The virtual hard disk will be copied before being attached to the virtual machine. If SourceImage is provided, the destination virtual hard drive must not exist.
*/
@JvmName("nwtxxtnnvqkmbjmp")
public suspend fun image(argument: suspend VirtualHardDiskArgsBuilder.() -> Unit) {
val toBeMapped = VirtualHardDiskArgsBuilder().applySuspend { argument() }.build()
val mapped = of(toBeMapped)
this.image = mapped
}
/**
* @param value The managed disk parameters.
*/
@JvmName("yxkylovfvwhshhsu")
public suspend fun managedDisk(`value`: ManagedDiskParametersArgs?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.managedDisk = mapped
}
/**
* @param argument The managed disk parameters.
*/
@JvmName("jwnmesxiuhgwohus")
public suspend fun managedDisk(argument: suspend ManagedDiskParametersArgsBuilder.() -> Unit) {
val toBeMapped = ManagedDiskParametersArgsBuilder().applySuspend { argument() }.build()
val mapped = of(toBeMapped)
this.managedDisk = mapped
}
/**
* @param value The disk name.
*/
@JvmName("rvijnbyephovpcsn")
public suspend fun name(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.name = mapped
}
/**
* @param value This property allows you to specify the type of the OS that is included in the disk if creating a VM from user-image or a specialized VHD. Possible values are: **Windows,** **Linux.**
*/
@JvmName("kibojfadqplwrqla")
public suspend fun osType(`value`: OperatingSystemTypes?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.osType = mapped
}
/**
* @param value The virtual hard disk.
*/
@JvmName("nlytrhfmnruxmwls")
public suspend fun vhd(`value`: VirtualHardDiskArgs?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.vhd = mapped
}
/**
* @param argument The virtual hard disk.
*/
@JvmName("sgwgylbuvoilvamm")
public suspend fun vhd(argument: suspend VirtualHardDiskArgsBuilder.() -> Unit) {
val toBeMapped = VirtualHardDiskArgsBuilder().applySuspend { argument() }.build()
val mapped = of(toBeMapped)
this.vhd = mapped
}
/**
* @param value Specifies whether writeAccelerator should be enabled or disabled on the disk.
*/
@JvmName("qhxgbkrwxdgutvxs")
public suspend fun writeAcceleratorEnabled(`value`: Boolean?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.writeAcceleratorEnabled = mapped
}
internal fun build(): OSDiskArgs = OSDiskArgs(
caching = caching,
createOption = createOption ?: throw PulumiNullFieldException("createOption"),
deleteOption = deleteOption,
diffDiskSettings = diffDiskSettings,
diskSizeGB = diskSizeGB,
encryptionSettings = encryptionSettings,
image = image,
managedDisk = managedDisk,
name = name,
osType = osType,
vhd = vhd,
writeAcceleratorEnabled = writeAcceleratorEnabled,
)
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy