Skip to content
Odinex Cloud
Terraform providerReferenceResources

odinex_volume

Manages a block storage volume. The size can grow in place; shrinking recreates the volume.

Manages a block storage volume. The size can grow in place; shrinking recreates the volume.

Example Usage

resource "odinex_volume" "data" {
  name      = "data"
  size      = 50
  server_id = odinex_server.web.id
}

Schema

Required

  • name (String) Name of the volume.
  • size (Number) Size in GB (10–10240). Growing is done online; shrinking recreates the volume.

Optional

  • delete_protection (Boolean) Prevent the resource from being deleted. Defaults to false.
  • labels (Map of String) User-defined labels (key/value pairs). Up to 64 pairs; keys and values up to 63 characters.
  • location (String) Location of the volume. Required unless server_id is set (then the server's location is used).
  • server_id (Number) Server to attach the volume to. Changing it detaches/attaches in place. Use either this or odinex_volume_attachment.
  • timeouts (Block, Optional)

Read-Only

  • id (String) Unique ID of the resource.
  • linux_device (String) Device path of the volume inside the server.

Nested Schema for timeouts

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).

Import

Import is supported using the following syntax:

The terraform import command can be used, for example:

terraform import odinex_volume.data 12

On this page