alicloud_ecs_disk

Provides an ECS Disk resource.

For information about ECS Disk and how to use it, see What is Disk.

Example Usage

Basic Usage

data "alicloud_zones" "example" {
  available_resource_creation = "VSwitch"
}

resource "alicloud_kms_key" "example" {
  description            = "terraform-example"
  pending_window_in_days = "7"
  status                 = "Enabled"
}

resource "alicloud_ecs_disk" "example" {
  zone_id     = data.alicloud_zones.example.zones.0.id
  disk_name   = "terraform-example"
  description = "terraform-example"
  category    = "cloud_efficiency"
  size        = "30"
  encrypted   = true
  kms_key_id  = alicloud_kms_key.example.id
  tags = {
    Name = "terraform-example"
  }
}

Deleting alicloud_ecs_disk or removing it from your configuration

The alicloud_ecs_disk resource allows you to manage payment_type = "Subscription" and delete_with_instance = true disk, but Terraform cannot destroy it. Deleting the subscription resource or removing it from your configuration will remove it from your state file and management, but will not destroy it. If you want to delete it, you can change it to PayAsYouGo and setting delete_with_instance = true and detach it from instance.

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

ECS Disk can be imported using the id, e.g.

$ terraform import alicloud_ecs_disk.example d-abcd12345