Перейти к содержимому

Снимок (snapshot) диска — это копия состояния диска

terraform
data "mws_compute_image" "image" {
image = "mws-ubuntu-2204-lts-v20250529"
project = "mws-ubuntu"
}
resource "mws_compute_disk" "disk" {
disk = var.disk_name
disk_type = "diskTypes/nbs-pl2"
iops = 1000
size = "10GB"
source = {
image = data.mws_compute_image.image.metadata.id
}
}
resource "mws_compute_snapshot" "snapshot" {
snapshot = var.snapshot_name
source = {
disk = {
id = mws_compute_disk.disk.metadata.id
}
}
}
variable "snapshot_name" {
type = string
default = "my-test-snapshot"
description = "Snapshot name"
}
variable "disk_name" {
type = string
default = "my-test-disk"
description = "Disk name"
}
  • snapshot (String) Путь к снимку
  • source (Attributes) Источник для создания снимка (На текущий момент поддерживается только диск, но в будущем будут и другие источники) (see below for nested schema)
  • kind (String) Тип объекта (snapshot)
  • metadata (Attributes) Дополнительная информация об объекте (see below for nested schema)
  • os_type (String) Тип операционной системы
  • project (String) Путь к проекту
  • timeouts (Attributes) (see below for nested schema)
  • id (String) The ID of this resource.
  • status (Attributes) Статус глобального снимка (see below for nested schema)

Optional:

Required:

  • id (String) ID диска-источника

Optional:

  • description (String) Описание ресурса
  • display_name (String) Отображаемое имя свойства
  • name (String, Deprecated) Обязательное уникальное, глобально или в пределах проекта, имя. Используется в качестве части составного идентификатора объекта.

Read-Only:

  • create_time (String) Дата создания объекта
  • delete_time (String) Время запроса на удаление ресурса
  • id (String) ID свойства
  • purge_time (String) Время удаления ресурса
  • usages (Attributes List) Связи с другими ресурсами. В зависимости от типа связи, операции над ресурсом могут быть ограничены (see below for nested schema)

Read-Only:

  • name (String) Имя связи, требуется для модификации коллекции
  • resource (String) Ссылка на ресурс
  • usage_type (String) Тип связи. Помимо стандартных own и use могут быть добавлены специализированные типы для конкретных сервисов

Optional:

  • create (String) A string that can be parsed as a duration consisting of numbers and unit suffixes, such as ”30s” or “2h45m”. Valid time units are “s” (seconds), “m” (minutes), “h” (hours).
  • delete (String) A string that can be parsed as a duration consisting of numbers and unit suffixes, such as ”30s” or “2h45m”. Valid time units are “s” (seconds), “m” (minutes), “h” (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs.
  • update (String) A string that can be parsed as a duration consisting of numbers and unit suffixes, such as ”30s” or “2h45m”. Valid time units are “s” (seconds), “m” (minutes), “h” (hours).

Read-Only:

  • initial_source_image (String) Ссылка на исходный образ
  • min_disk_size (String) Минимальный допустимый размер диска, создаваемого из снимка
  • os_type (String) Тип операционной системы
  • progress (String) Прогресс готовности снимка в процентах, с точностью до сотых
  • ready (Attributes) Информация о статусе реконсиляции (see below for nested schema)
  • source_exists (Boolean) Признак, указывающий, удален ли родительский ресурс-источник
  • storage_size (String) Размер снимка

Read-Only:

  • message (String) Описание статуса
  • state (String) Состояние ресурса