alicloud_ens_disk_instance_attachment

Provides a ENS Disk Instance Attachment resource. Disk instance mount.

For information about ENS Disk Instance Attachment and how to use it, see What is Disk Instance Attachment.

Example Usage

Basic Usage

variable "name" {
  default = "terraform-example"
}

provider "alicloud" {
  region = "cn-hangzhou"
}

resource "alicloud_ens_disk" "default" {
  size          = "20"
  ens_region_id = "cn-chenzhou-telecom_unicom_cmcc"
  payment_type  = "PayAsYouGo"
  category      = "cloud_efficiency"
}

resource "alicloud_ens_instance" "default" {
  system_disk {
    size = "20"
  }
  image_id                   = "centos_6_08_64_20G_alibase_20171208"
  payment_type               = "Subscription"
  instance_type              = "ens.sn1.stiny"
  password                   = "12345678ABCabc"
  amount                     = "1"
  internet_max_bandwidth_out = "10"
  unique_suffix              = true
  public_ip_identification   = true
  ens_region_id              = "cn-chenzhou-telecom_unicom_cmcc"
  schedule_area_level        = "Region"
  period_unit                = "Month"
  period                     = "1"
}


resource "alicloud_ens_disk_instance_attachment" "default" {
  instance_id          = alicloud_ens_instance.default.id
  delete_with_instance = "false"
  disk_id              = alicloud_ens_disk.default.id
}

Argument Reference

The following arguments are supported:

Attributes Reference

The following attributes are exported:

Timeouts

The timeouts block allows you to specify timeouts for certain actions:

Import

ENS Disk Instance Attachment can be imported using the id, e.g.

$ terraform import alicloud_ens_disk_instance_attachment.example <disk_id>:<instance_id>