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

com.pulumi.awsnative.ec2.kotlin.VolumeAttachmentArgs.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: 1.24.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.awsnative.ec2.kotlin

import com.pulumi.awsnative.ec2.VolumeAttachmentArgs.builder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.String
import kotlin.Suppress
import kotlin.jvm.JvmName

/**
 * Attaches an Amazon EBS volume to a running instance and exposes it to the instance with the specified device name.
 *  Before this resource can be deleted (and therefore the volume detached), you must first unmount the volume in the instance. Failure to do so results in the volume being stuck in the busy state while it is trying to detach, which could possibly damage the file system or the data it contains.
 *  If an Amazon EBS volume is the root device of an instance, it cannot be detached while the instance is in the "running" state. To detach the root volume, stop the instance first.
 *  If the root volume is detached from an instance with an MKT product code, then the product codes from that volume are no longer associated with the instance.
 * @property device The device name (for example, ``/dev/sdh`` or ``xvdh``).
 * @property instanceId The ID of the instance to which the volume attaches. This value can be a reference to an [AWS::EC2::Instance](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-instance.html) resource, or it can be the physical ID of an existing EC2 instance.
 * @property volumeId The ID of the Amazon EBS volume. The volume and instance must be within the same Availability Zone. This value can be a reference to an [AWS::EC2::Volume](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-ebs-volume.html) resource, or it can be the volume ID of an existing Amazon EBS volume.
 */
public data class VolumeAttachmentArgs(
    public val device: Output? = null,
    public val instanceId: Output? = null,
    public val volumeId: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.awsnative.ec2.VolumeAttachmentArgs =
        com.pulumi.awsnative.ec2.VolumeAttachmentArgs.builder()
            .device(device?.applyValue({ args0 -> args0 }))
            .instanceId(instanceId?.applyValue({ args0 -> args0 }))
            .volumeId(volumeId?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [VolumeAttachmentArgs].
 */
@PulumiTagMarker
public class VolumeAttachmentArgsBuilder internal constructor() {
    private var device: Output? = null

    private var instanceId: Output? = null

    private var volumeId: Output? = null

    /**
     * @param value The device name (for example, ``/dev/sdh`` or ``xvdh``).
     */
    @JvmName("narfdmjjejbgjdvm")
    public suspend fun device(`value`: Output) {
        this.device = value
    }

    /**
     * @param value The ID of the instance to which the volume attaches. This value can be a reference to an [AWS::EC2::Instance](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-instance.html) resource, or it can be the physical ID of an existing EC2 instance.
     */
    @JvmName("junorfnsumsqjaby")
    public suspend fun instanceId(`value`: Output) {
        this.instanceId = value
    }

    /**
     * @param value The ID of the Amazon EBS volume. The volume and instance must be within the same Availability Zone. This value can be a reference to an [AWS::EC2::Volume](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-ebs-volume.html) resource, or it can be the volume ID of an existing Amazon EBS volume.
     */
    @JvmName("fggxymitibkdohiy")
    public suspend fun volumeId(`value`: Output) {
        this.volumeId = value
    }

    /**
     * @param value The device name (for example, ``/dev/sdh`` or ``xvdh``).
     */
    @JvmName("gtgricgcwxxcuijr")
    public suspend fun device(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.device = mapped
    }

    /**
     * @param value The ID of the instance to which the volume attaches. This value can be a reference to an [AWS::EC2::Instance](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-instance.html) resource, or it can be the physical ID of an existing EC2 instance.
     */
    @JvmName("ydulwosrikapbfge")
    public suspend fun instanceId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.instanceId = mapped
    }

    /**
     * @param value The ID of the Amazon EBS volume. The volume and instance must be within the same Availability Zone. This value can be a reference to an [AWS::EC2::Volume](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-ebs-volume.html) resource, or it can be the volume ID of an existing Amazon EBS volume.
     */
    @JvmName("kjdioyhckebwuvup")
    public suspend fun volumeId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.volumeId = mapped
    }

    internal fun build(): VolumeAttachmentArgs = VolumeAttachmentArgs(
        device = device,
        instanceId = instanceId,
        volumeId = volumeId,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy