alicloud_disk
Provides a ECS disk resource.
NOTE: One of
sizeorsnapshot_idis required when specifying an ECS disk. If all of them be specified,sizemust more than the size of snapshot whichsnapshot_idrepresents. Currently,alicloud_diskdoesn't resize disk.
Example Usage
# Create a new ECS disk.
resource "alicloud_disk" "ecs_disk" {
  # cn-beijing
  availability_zone = "cn-beijing-b"
  name              = "New-disk"
  description       = "Hello ecs disk."
  category          = "cloud_efficiency"
  size              = "30"
  tags {
    Name = "TerraformTest"
  }
}
Argument Reference
The following arguments are supported:
- 
availability_zone- (Required, Forces new resource) The Zone to create the disk in.
- 
name- (Optional) Name of the ECS disk. This name can have a string of 2 to 128 characters, must contain only alphanumeric characters or hyphens, such as "-",".","_", and must not begin or end with a hyphen, and must not begin with http:// or https://. Default value is null.
- 
description- (Optional) Description of the disk. This description can have a string of 2 to 256 characters, It cannot begin with http:// or https://. Default value is null.
- 
category- (Optional, Forces new resource) Category of the disk. Valid values arecloud,cloud_efficiencyandcloud_ssd. Default iscloud_efficiency.
- 
size- (Required) The size of the disk in GiBs, and it value range: 20 ~ 32768.
- 
snapshot_id- (Optional) A snapshot to base the disk off of. If it is specified,sizewill be invalid and the disk size is equals to the snapshot size.
- 
tags- (Optional) A mapping of tags to assign to the resource.
- 
encrypted- (Optional) If true, the disk will be encrypted
NOTE: Disk category
cloudhas been outdated and it only can be used none I/O Optimized ECS instances. Recommendcloud_efficiencyandcloud_ssddisk.
Attributes Reference
The following attributes are exported:
- 
id- The disk ID.
- 
availability_zone- The Zone to create the disk in.
- 
name- The disk name.
- 
description- The disk description.
- 
status- The disk status.
- 
category- The disk category.
- 
size- The disk size.
- 
snapshot_id- The disk snapshot ID.
- 
tags- The disk tags.
- 
encrypted- Whether the disk is encrypted.
Import
Cloud disk can be imported using the id, e.g.
$ terraform import alicloud_disk.example d-abc12345678
    © 2018 HashiCorpLicensed under the MPL 2.0 License.
    https://www.terraform.io/docs/providers/alicloud/r/disk.html