Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.azurenative.compute.kotlin.inputs
import com.pulumi.azurenative.compute.inputs.DataDiskArgs.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.DiskDetachOptionTypes
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
/**
* Describes a data disk.
* @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 data disk should be deleted or detached upon VM deletion. Possible values are: **Delete.** If this value is used, the data disk is deleted when VM is deleted. **Detach.** If this value is used, the data disk is retained after VM is deleted. The default value is set to **Detach**.
* @property detachOption Specifies the detach behavior to be used while detaching a disk or which is already in the process of detachment from the virtual machine. Supported values: **ForceDetach.** detachOption: **ForceDetach** is applicable only for managed data disks. If a previous detachment attempt of the data disk did not complete due to an unexpected failure from the virtual machine and the disk is still not released then use force-detach as a last resort option to detach the disk forcibly from the VM. All writes might not have been flushed when using this detach behavior. **This feature is still in preview** mode and is not supported for VirtualMachineScaleSet. To force-detach a data disk update toBeDetached to 'true' along with setting detachOption: 'ForceDetach'.
* @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 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 lun Specifies the logical unit number of the data disk. This value is used to identify data disks within the VM and therefore must be unique for each data disk attached to a VM.
* @property managedDisk The managed disk parameters.
* @property name The disk name.
* @property toBeDetached Specifies whether the data disk is in process of detachment from the VirtualMachine/VirtualMachineScaleset
* @property vhd The virtual hard disk.
* @property writeAcceleratorEnabled Specifies whether writeAccelerator should be enabled or disabled on the disk.
*/
public data class DataDiskArgs(
public val caching: Output? = null,
public val createOption: Output>,
public val deleteOption: Output>? = null,
public val detachOption: Output>? = null,
public val diskSizeGB: Output? = null,
public val image: Output? = null,
public val lun: Output,
public val managedDisk: Output? = null,
public val name: Output? = null,
public val toBeDetached: Output? = null,
public val vhd: Output? = null,
public val writeAcceleratorEnabled: Output? = null,
) : ConvertibleToJava {
override fun toJava(): com.pulumi.azurenative.compute.inputs.DataDiskArgs =
com.pulumi.azurenative.compute.inputs.DataDiskArgs.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() })
})
}),
)
.detachOption(
detachOption?.applyValue({ args0 ->
args0.transform({ args0 -> args0 }, { args0 ->
args0.let({ args0 -> args0.toJava() })
})
}),
)
.diskSizeGB(diskSizeGB?.applyValue({ args0 -> args0 }))
.image(image?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
.lun(lun.applyValue({ args0 -> args0 }))
.managedDisk(managedDisk?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
.name(name?.applyValue({ args0 -> args0 }))
.toBeDetached(toBeDetached?.applyValue({ args0 -> args0 }))
.vhd(vhd?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
.writeAcceleratorEnabled(writeAcceleratorEnabled?.applyValue({ args0 -> args0 })).build()
}
/**
* Builder for [DataDiskArgs].
*/
@PulumiTagMarker
public class DataDiskArgsBuilder internal constructor() {
private var caching: Output? = null
private var createOption: Output>? = null
private var deleteOption: Output>? = null
private var detachOption: Output>? = null
private var diskSizeGB: Output? = null
private var image: Output? = null
private var lun: Output? = null
private var managedDisk: Output? = null
private var name: Output? = null
private var toBeDetached: 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("vmietnclrqttrflq")
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("tpbwnkkxdueascsx")
public suspend fun createOption(`value`: Output>) {
this.createOption = value
}
/**
* @param value Specifies whether data disk should be deleted or detached upon VM deletion. Possible values are: **Delete.** If this value is used, the data disk is deleted when VM is deleted. **Detach.** If this value is used, the data disk is retained after VM is deleted. The default value is set to **Detach**.
*/
@JvmName("hxuaexlivdkluhwm")
public suspend fun deleteOption(`value`: Output>) {
this.deleteOption = value
}
/**
* @param value Specifies the detach behavior to be used while detaching a disk or which is already in the process of detachment from the virtual machine. Supported values: **ForceDetach.** detachOption: **ForceDetach** is applicable only for managed data disks. If a previous detachment attempt of the data disk did not complete due to an unexpected failure from the virtual machine and the disk is still not released then use force-detach as a last resort option to detach the disk forcibly from the VM. All writes might not have been flushed when using this detach behavior. **This feature is still in preview** mode and is not supported for VirtualMachineScaleSet. To force-detach a data disk update toBeDetached to 'true' along with setting detachOption: 'ForceDetach'.
*/
@JvmName("vjhpqtewjolucpfa")
public suspend fun detachOption(`value`: Output>) {
this.detachOption = 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("rukxuxoemsjnnvxg")
public suspend fun diskSizeGB(`value`: Output) {
this.diskSizeGB = 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("unxkmsjwonspuejc")
public suspend fun image(`value`: Output) {
this.image = value
}
/**
* @param value Specifies the logical unit number of the data disk. This value is used to identify data disks within the VM and therefore must be unique for each data disk attached to a VM.
*/
@JvmName("ofwaoprhhlgurnyk")
public suspend fun lun(`value`: Output) {
this.lun = value
}
/**
* @param value The managed disk parameters.
*/
@JvmName("kieeecqholqqewuu")
public suspend fun managedDisk(`value`: Output) {
this.managedDisk = value
}
/**
* @param value The disk name.
*/
@JvmName("kivamwovqnanfjyk")
public suspend fun name(`value`: Output) {
this.name = value
}
/**
* @param value Specifies whether the data disk is in process of detachment from the VirtualMachine/VirtualMachineScaleset
*/
@JvmName("necfjcnrjsgfsaul")
public suspend fun toBeDetached(`value`: Output) {
this.toBeDetached = value
}
/**
* @param value The virtual hard disk.
*/
@JvmName("jqbbxaokptovqxoe")
public suspend fun vhd(`value`: Output) {
this.vhd = value
}
/**
* @param value Specifies whether writeAccelerator should be enabled or disabled on the disk.
*/
@JvmName("gbhsntsbtjlpuvuv")
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("pbucrjyriajjcdiv")
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("nujgfdwmxdcgdgsw")
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("lqeeppssskxnffmj")
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("hwqkdousswavkjcq")
public fun createOption(`value`: DiskCreateOptionTypes) {
val toBeMapped = Either.ofRight(value)
val mapped = toBeMapped.let({ args0 -> of(args0) })
this.createOption = mapped
}
/**
* @param value Specifies whether data disk should be deleted or detached upon VM deletion. Possible values are: **Delete.** If this value is used, the data disk is deleted when VM is deleted. **Detach.** If this value is used, the data disk is retained after VM is deleted. The default value is set to **Detach**.
*/
@JvmName("eljcklpmakxrqiwi")
public suspend fun deleteOption(`value`: Either?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.deleteOption = mapped
}
/**
* @param value Specifies whether data disk should be deleted or detached upon VM deletion. Possible values are: **Delete.** If this value is used, the data disk is deleted when VM is deleted. **Detach.** If this value is used, the data disk is retained after VM is deleted. The default value is set to **Detach**.
*/
@JvmName("vvamyuornjlpuaxf")
public fun deleteOption(`value`: String) {
val toBeMapped = Either.ofLeft(value)
val mapped = toBeMapped.let({ args0 -> of(args0) })
this.deleteOption = mapped
}
/**
* @param value Specifies whether data disk should be deleted or detached upon VM deletion. Possible values are: **Delete.** If this value is used, the data disk is deleted when VM is deleted. **Detach.** If this value is used, the data disk is retained after VM is deleted. The default value is set to **Detach**.
*/
@JvmName("qrxittwjqmrltxki")
public fun deleteOption(`value`: DiskDeleteOptionTypes) {
val toBeMapped = Either.ofRight(value)
val mapped = toBeMapped.let({ args0 -> of(args0) })
this.deleteOption = mapped
}
/**
* @param value Specifies the detach behavior to be used while detaching a disk or which is already in the process of detachment from the virtual machine. Supported values: **ForceDetach.** detachOption: **ForceDetach** is applicable only for managed data disks. If a previous detachment attempt of the data disk did not complete due to an unexpected failure from the virtual machine and the disk is still not released then use force-detach as a last resort option to detach the disk forcibly from the VM. All writes might not have been flushed when using this detach behavior. **This feature is still in preview** mode and is not supported for VirtualMachineScaleSet. To force-detach a data disk update toBeDetached to 'true' along with setting detachOption: 'ForceDetach'.
*/
@JvmName("ewctsniucklcojce")
public suspend fun detachOption(`value`: Either?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.detachOption = mapped
}
/**
* @param value Specifies the detach behavior to be used while detaching a disk or which is already in the process of detachment from the virtual machine. Supported values: **ForceDetach.** detachOption: **ForceDetach** is applicable only for managed data disks. If a previous detachment attempt of the data disk did not complete due to an unexpected failure from the virtual machine and the disk is still not released then use force-detach as a last resort option to detach the disk forcibly from the VM. All writes might not have been flushed when using this detach behavior. **This feature is still in preview** mode and is not supported for VirtualMachineScaleSet. To force-detach a data disk update toBeDetached to 'true' along with setting detachOption: 'ForceDetach'.
*/
@JvmName("fxfrlextoayimoto")
public fun detachOption(`value`: String) {
val toBeMapped = Either.ofLeft(value)
val mapped = toBeMapped.let({ args0 -> of(args0) })
this.detachOption = mapped
}
/**
* @param value Specifies the detach behavior to be used while detaching a disk or which is already in the process of detachment from the virtual machine. Supported values: **ForceDetach.** detachOption: **ForceDetach** is applicable only for managed data disks. If a previous detachment attempt of the data disk did not complete due to an unexpected failure from the virtual machine and the disk is still not released then use force-detach as a last resort option to detach the disk forcibly from the VM. All writes might not have been flushed when using this detach behavior. **This feature is still in preview** mode and is not supported for VirtualMachineScaleSet. To force-detach a data disk update toBeDetached to 'true' along with setting detachOption: 'ForceDetach'.
*/
@JvmName("fgffporaulxogjrk")
public fun detachOption(`value`: DiskDetachOptionTypes) {
val toBeMapped = Either.ofRight(value)
val mapped = toBeMapped.let({ args0 -> of(args0) })
this.detachOption = 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("tnywauhmfjsqvibv")
public suspend fun diskSizeGB(`value`: Int?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.diskSizeGB = 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("uafwbqgpdnbkrioh")
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("sgqjsjpomxeyoawl")
public suspend fun image(argument: suspend VirtualHardDiskArgsBuilder.() -> Unit) {
val toBeMapped = VirtualHardDiskArgsBuilder().applySuspend { argument() }.build()
val mapped = of(toBeMapped)
this.image = mapped
}
/**
* @param value Specifies the logical unit number of the data disk. This value is used to identify data disks within the VM and therefore must be unique for each data disk attached to a VM.
*/
@JvmName("gkhvqpnrseltjxpb")
public suspend fun lun(`value`: Int) {
val toBeMapped = value
val mapped = toBeMapped.let({ args0 -> of(args0) })
this.lun = mapped
}
/**
* @param value The managed disk parameters.
*/
@JvmName("stvtraoogewwnicu")
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("urqqaitfvmjbnkac")
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("oigshodckejyomve")
public suspend fun name(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.name = mapped
}
/**
* @param value Specifies whether the data disk is in process of detachment from the VirtualMachine/VirtualMachineScaleset
*/
@JvmName("yibyogayvatlupfw")
public suspend fun toBeDetached(`value`: Boolean?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.toBeDetached = mapped
}
/**
* @param value The virtual hard disk.
*/
@JvmName("npuaaddhppoqgfnh")
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("xlogufbluowvetrs")
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("ixregybyebgrkrss")
public suspend fun writeAcceleratorEnabled(`value`: Boolean?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.writeAcceleratorEnabled = mapped
}
internal fun build(): DataDiskArgs = DataDiskArgs(
caching = caching,
createOption = createOption ?: throw PulumiNullFieldException("createOption"),
deleteOption = deleteOption,
detachOption = detachOption,
diskSizeGB = diskSizeGB,
image = image,
lun = lun ?: throw PulumiNullFieldException("lun"),
managedDisk = managedDisk,
name = name,
toBeDetached = toBeDetached,
vhd = vhd,
writeAcceleratorEnabled = writeAcceleratorEnabled,
)
}