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

com.pulumi.gcp.compute.kotlin.outputs.InstanceTemplateDisk.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.10.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.gcp.compute.kotlin.outputs

import kotlin.Boolean
import kotlin.Int
import kotlin.String
import kotlin.Suppress
import kotlin.collections.Map

/**
 *
 * @property autoDelete Whether or not the disk should be auto-deleted.
 * This defaults to true.
 * @property boot Indicates that this is a boot disk.
 * @property deviceName A unique device name that is reflected into the
 * /dev/  tree of a Linux operating system running within the instance. If not
 * specified, the server chooses a default device name to apply to this disk.
 * @property diskEncryptionKey Encrypts or decrypts a disk using a customer-supplied encryption key.
 * If you are creating a new disk, this field encrypts the new disk using an encryption key that you provide. If you are attaching an existing disk that is already encrypted, this field decrypts the disk using the customer-supplied encryption key.
 * If you encrypt a disk using a customer-supplied key, you must provide the same key again when you attempt to use this resource at a later time. For example, you must provide the key when you create a snapshot or an image from the disk or when you attach the disk to a virtual machine instance.
 * If you do not provide an encryption key, then the disk will be encrypted using an automatically generated key and you do not need to provide a key to use the disk later.
 * Instance templates do not store customer-supplied encryption keys, so you cannot use your own keys to encrypt disks in a managed instance group. Structure documented below.
 * @property diskName Name of the disk. When not provided, this defaults
 * to the name of the instance.
 * @property diskSizeGb The size of the image in gigabytes. If not
 * specified, it will inherit the size of its base image. For SCRATCH disks,
 * the size must be exactly 375GB.
 * @property diskType The GCE disk type. Such as `"pd-ssd"`, `"local-ssd"`,
 * `"pd-balanced"` or `"pd-standard"`.
 * @property interface Specifies the disk interface to use for attaching this disk,
 * which is either SCSI or NVME. The default is SCSI. Persistent disks must always use SCSI
 * and the request will fail if you attempt to attach a persistent disk in any other format
 * than SCSI. Local SSDs can use either NVME or SCSI.
 * @property labels A set of ket/value label pairs to assign to disk created from
 * this template
 * @property mode The mode in which to attach this disk, either READ_WRITE
 * or READ_ONLY. If you are attaching or creating a boot disk, this must
 * read-write mode.
 * @property provisionedIops Indicates how many IOPS to provision for the disk. This
 * sets the number of I/O operations per second that the disk can handle.
 * Values must be between 10,000 and 120,000. For more details, see the
 * [Extreme persistent disk documentation](https://cloud.google.com/compute/docs/disks/extreme-persistent-disk).
 * @property resourceManagerTags A set of key/value resource manager tag pairs to bind to this disk. Keys must be in the format tagKeys/{tag_key_id}, and values are in the format tagValues/456.
 * @property resourcePolicies - A list (short name or id) of resource policies to attach to this disk for automatic snapshot creations. Currently a max of 1 resource policy is supported.
 * @property source The name (**not self_link**)
 * of the disk (such as those managed by `gcp.compute.Disk`) to attach.
 * > **Note:** Either `source`, `source_image`, or `source_snapshot` is **required** in a disk block unless the disk type is `local-ssd`. Check the API [docs](https://cloud.google.com/compute/docs/reference/rest/v1/instanceTemplates/insert) for details.
 * @property sourceImage The image from which to
 * initialize this disk. This can be one of: the image's `self_link`,
 * `projects/{project}/global/images/{image}`,
 * `projects/{project}/global/images/family/{family}`, `global/images/{image}`,
 * `global/images/family/{family}`, `family/{family}`, `{project}/{family}`,
 * `{project}/{image}`, `{family}`, or `{image}`.
 * > **Note:** Either `source`, `source_image`, or `source_snapshot` is **required** in a disk block unless the disk type is `local-ssd`. Check the API [docs](https://cloud.google.com/compute/docs/reference/rest/v1/instanceTemplates/insert) for details.
 * @property sourceImageEncryptionKey The customer-supplied encryption
 * key of the source image. Required if the source image is protected by a
 * customer-supplied encryption key.
 * Instance templates do not store customer-supplied encryption keys, so you
 * cannot create disks for instances in a managed instance group if the source
 * images are encrypted with your own keys. Structure
 * documented below.
 * @property sourceSnapshot The source snapshot to create this disk.
 * > **Note:** Either `source`, `source_image`, or `source_snapshot` is **required** in a disk block unless the disk type is `local-ssd`. Check the API [docs](https://cloud.google.com/compute/docs/reference/rest/v1/instanceTemplates/insert) for details.
 * @property sourceSnapshotEncryptionKey The customer-supplied encryption
 * key of the source snapshot. Structure
 * documented below.
 * @property type The type of GCE disk, can be either `"SCRATCH"` or
 * `"PERSISTENT"`.
 */
public data class InstanceTemplateDisk(
    public val autoDelete: Boolean? = null,
    public val boot: Boolean? = null,
    public val deviceName: String? = null,
    public val diskEncryptionKey: InstanceTemplateDiskDiskEncryptionKey? = null,
    public val diskName: String? = null,
    public val diskSizeGb: Int? = null,
    public val diskType: String? = null,
    public val `interface`: String? = null,
    public val labels: Map? = null,
    public val mode: String? = null,
    public val provisionedIops: Int? = null,
    public val resourceManagerTags: Map? = null,
    public val resourcePolicies: String? = null,
    public val source: String? = null,
    public val sourceImage: String? = null,
    public val sourceImageEncryptionKey: InstanceTemplateDiskSourceImageEncryptionKey? = null,
    public val sourceSnapshot: String? = null,
    public val sourceSnapshotEncryptionKey: InstanceTemplateDiskSourceSnapshotEncryptionKey? = null,
    public val type: String? = null,
) {
    public companion object {
        public fun toKotlin(javaType: com.pulumi.gcp.compute.outputs.InstanceTemplateDisk): InstanceTemplateDisk = InstanceTemplateDisk(
            autoDelete = javaType.autoDelete().map({ args0 -> args0 }).orElse(null),
            boot = javaType.boot().map({ args0 -> args0 }).orElse(null),
            deviceName = javaType.deviceName().map({ args0 -> args0 }).orElse(null),
            diskEncryptionKey = javaType.diskEncryptionKey().map({ args0 ->
                args0.let({ args0 ->
                    com.pulumi.gcp.compute.kotlin.outputs.InstanceTemplateDiskDiskEncryptionKey.Companion.toKotlin(args0)
                })
            }).orElse(null),
            diskName = javaType.diskName().map({ args0 -> args0 }).orElse(null),
            diskSizeGb = javaType.diskSizeGb().map({ args0 -> args0 }).orElse(null),
            diskType = javaType.diskType().map({ args0 -> args0 }).orElse(null),
            `interface` = javaType.interface_().map({ args0 -> args0 }).orElse(null),
            labels = javaType.labels().map({ args0 -> args0.key.to(args0.value) }).toMap(),
            mode = javaType.mode().map({ args0 -> args0 }).orElse(null),
            provisionedIops = javaType.provisionedIops().map({ args0 -> args0 }).orElse(null),
            resourceManagerTags = javaType.resourceManagerTags().map({ args0 ->
                args0.key.to(args0.value)
            }).toMap(),
            resourcePolicies = javaType.resourcePolicies().map({ args0 -> args0 }).orElse(null),
            source = javaType.source().map({ args0 -> args0 }).orElse(null),
            sourceImage = javaType.sourceImage().map({ args0 -> args0 }).orElse(null),
            sourceImageEncryptionKey = javaType.sourceImageEncryptionKey().map({ args0 ->
                args0.let({ args0 ->
                    com.pulumi.gcp.compute.kotlin.outputs.InstanceTemplateDiskSourceImageEncryptionKey.Companion.toKotlin(args0)
                })
            }).orElse(null),
            sourceSnapshot = javaType.sourceSnapshot().map({ args0 -> args0 }).orElse(null),
            sourceSnapshotEncryptionKey = javaType.sourceSnapshotEncryptionKey().map({ args0 ->
                args0.let({ args0 ->
                    com.pulumi.gcp.compute.kotlin.outputs.InstanceTemplateDiskSourceSnapshotEncryptionKey.Companion.toKotlin(args0)
                })
            }).orElse(null),
            type = javaType.type().map({ args0 -> args0 }).orElse(null),
        )
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy