پرش به مطلب اصلی

arvancloud_iaas_volume (Resource)

Manages an IaaS block storage volume in a specific availability zone.

Example Usage

# Create a volume with all required fields.
resource "arvancloud_iaas_volume" "data_vol" {
name = "my-data-volume"
size = 50
availability_zone = "ir-central1-a"
}

# Create a volume with optional fields.
resource "arvancloud_iaas_volume" "app_vol" {
name = "app-volume"
description = "Application data volume"
size = 100
type = "ssd"
availability_zone = "ir-central1-a"
}

output "data_volume_id" {
value = arvancloud_iaas_volume.data_vol.id
}

output "data_volume_status" {
value = arvancloud_iaas_volume.data_vol.status
}

output "data_volume_region" {
value = arvancloud_iaas_volume.data_vol.region
}

output "app_volume_type" {
value = arvancloud_iaas_volume.app_vol.type
}

output "app_volume_created_at" {
value = arvancloud_iaas_volume.app_vol.created_at
}

Schema

Required

  • availability_zone (String) Availability zone where the volume will be created (e.g. ir-central1-a). Changing this value forces a new resource to be created.
  • name (String) Name of the volume.
  • size (Number) Size of the volume in GiB. Changing this value forces a new resource to be created.

Optional

  • description (String) Description of the volume.
  • type (String) Volume type (hdd, ssd). Changing this value forces a new resource to be created.

Read-Only

  • bootable (String) Whether the volume is bootable.
  • created_at (String) Timestamp when the volume was created.
  • id (String) Unique identifier of the volume assigned by the API.
  • region (String) Region where the volume is stored (e.g. ir-central1).
  • server_id (String) ID of the server instance the volume is attached to, if any.
  • server_name (String) Name of the server instance the volume is attached to, if any.
  • status (String) Current status of the volume (e.g. available, in-use).

Import

Import is supported using the following syntax:

terraform import arvancloud_iaas_volume.example ir-central1-a:0ea14e62-3b69-4bcd-8717-1e9a5c9212b5