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

arvancloud_iaas_images (Data Source)

Lists IaaS images, optionally filtered by region, availability zone, or image type.

Example Usage

# List all images across all regions and availability zones
data "arvancloud_iaas_images" "all" {}

output "all_image_names" {
value = [for img in data.arvancloud_iaas_images.all.images : "${img.name} (${img.availability_zone}) [${img.type}]"]
}

# List images in a specific availability zone
data "arvancloud_iaas_images" "az_a" {
availability_zone = "ir-central1-a"
}

# List only private images (user-uploaded)
data "arvancloud_iaas_images" "private" {
availability_zone = "ir-central1-a"
image_type = "private"
}

output "private_image_ids" {
value = [for img in data.arvancloud_iaas_images.private.images : img.id]
}

Schema

Optional

  • availability_zone (String) Filter images by availability zone code name (e.g. ir-central1-a). Cannot be combined with region.
  • image_type (String) Filter images by type. Valid values: private, arvan, distro, distributions. Defaults to all types.

Read-Only

  • id (String) Unique identifier for this data source.
  • images (Attributes List) List of images matching the specified filters. (see below for nested schema)

Nested Schema for images

Read-Only:

  • availability_zone (String) Availability zone where the image is stored (e.g. ir-central1-a).
  • created_at (String) Timestamp when the image was created.
  • disk_format (String) Disk format of the image (e.g. qcow2, raw).
  • distribution_name (String) Name of the Linux distribution (if applicable).
  • enable_uefi (Boolean) Whether UEFI boot is enabled for this image.
  • id (String) Unique identifier of the image.
  • min_disk (Number) Minimum disk size in GB required to boot this image.
  • min_ram (Number) Minimum RAM in MB required to boot this image.
  • name (String) Name of the image.
  • region (String) Region where the image is stored (e.g. ir-central1).
  • size (Number) Size of the image in bytes.
  • ssh_key (Boolean) Whether the image supports SSH key authentication.
  • ssh_password (Boolean) Whether the image supports password authentication.
  • status (String) Current status of the image (e.g. active, queued).
  • type (String) Image category (e.g. private, arvan, distro).