EcsDiskAttachmentArgs

data class EcsDiskAttachmentArgs(val bootable: Output<Boolean>? = null, val deleteWithInstance: Output<Boolean>? = null, val diskId: Output<String>? = null, val instanceId: Output<String>? = null, val keyPairName: Output<String>? = null, val password: Output<String>? = null) : ConvertibleToJava<EcsDiskAttachmentArgs>

Provides an Alicloud ECS Disk Attachment as a resource, to attach and detach disks from ECS Instances. For information about ECS Disk Attachment and how to use it, see What is Disk Attachment.

NOTE: Available in v1.122.0+.

Example Usage

Basic usage

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.ecs.SecurityGroup;
import com.pulumi.alicloud.ecs.SecurityGroupArgs;
import com.pulumi.alicloud.ecs.EcsDisk;
import com.pulumi.alicloud.ecs.EcsDiskArgs;
import com.pulumi.alicloud.ecs.Instance;
import com.pulumi.alicloud.ecs.InstanceArgs;
import com.pulumi.alicloud.ecs.EcsDiskAttachment;
import com.pulumi.alicloud.ecs.EcsDiskAttachmentArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var ecsSg = new SecurityGroup("ecsSg", SecurityGroupArgs.builder()
.description("New security group")
.build());
var ecsDisk = new EcsDisk("ecsDisk", EcsDiskArgs.builder()
.zoneId("cn-beijing-a")
.size("50")
.tags(Map.of("Name", "TerraformTest-disk"))
.build());
var ecsInstance = new Instance("ecsInstance", InstanceArgs.builder()
.imageId("ubuntu_18_04_64_20G_alibase_20190624.vhd")
.instanceType("ecs.n4.small")
.availabilityZone("cn-beijing-a")
.securityGroups(ecsSg.id())
.instanceName("Hello")
.internetChargeType("PayByBandwidth")
.tags(Map.of("Name", "TerraformTest-instance"))
.build());
var ecsDiskAtt = new EcsDiskAttachment("ecsDiskAtt", EcsDiskAttachmentArgs.builder()
.diskId(ecsDisk.id())
.instanceId(ecsInstance.id())
.build());
}
}

Import

The disk attachment can be imported using the id, e.g.

$ pulumi import alicloud:ecs/ecsDiskAttachment:EcsDiskAttachment example d-abc12345678:i-abc12355

Constructors

Link copied to clipboard
fun EcsDiskAttachmentArgs(bootable: Output<Boolean>? = null, deleteWithInstance: Output<Boolean>? = null, diskId: Output<String>? = null, instanceId: Output<String>? = null, keyPairName: Output<String>? = null, password: Output<String>? = null)

Functions

Link copied to clipboard
open override fun toJava(): EcsDiskAttachmentArgs

Properties

Link copied to clipboard
val bootable: Output<Boolean>? = null

Whether to mount as a system disk. Default to: false.

Link copied to clipboard
val deleteWithInstance: Output<Boolean>? = null

Indicates whether the disk is released together with the instance. Default to: false.

Link copied to clipboard
val diskId: Output<String>? = null

ID of the Disk to be attached.

Link copied to clipboard
val instanceId: Output<String>? = null

ID of the Instance to attach to.

Link copied to clipboard
val keyPairName: Output<String>? = null

The name of key pair

Link copied to clipboard
val password: Output<String>? = null

When mounting the system disk, setting the user name and password of the instance is only effective for the administrator and root user names, and other user names are not effective.