Skip to content

Latest commit

 

History

History
85 lines (63 loc) · 4.76 KB

File metadata and controls

85 lines (63 loc) · 4.76 KB
page_title subcategory description
stackit_volume Resource - stackit
Volume resource schema. Must have a region specified in the provider configuration. -> Note: Write-Only argument key_payload_base64_wo is available to use in place of key_payload_base64. Write-Only arguments are supported in HashiCorp Terraform 1.11.0 and later. Learn more https://developer.hashicorp.com/terraform/language/resources/ephemeral#write-only-arguments.

stackit_volume (Resource)

Volume resource schema. Must have a region specified in the provider configuration.

-> Note: Write-Only argument key_payload_base64_wo is available to use in place of key_payload_base64. Write-Only arguments are supported in HashiCorp Terraform 1.11.0 and later. Learn more.

Example Usage

resource "stackit_volume" "example" {
  project_id        = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
  name              = "my_volume"
  availability_zone = "eu01-1"
  size              = 64
  labels = {
    "key" = "value"
  }
}

# Only use the import statement, if you want to import an existing volume
import {
  to = stackit_volume.import-example
  id = "${var.project_id},${var.region},${var.volume_id}"
}

Schema

Required

  • availability_zone (String) The availability zone of the volume.
  • project_id (String) STACKIT project ID to which the volume is associated.

Optional

  • description (String) The description of the volume.
  • encryption_parameters (Attributes) Parameter to connect to a key-encryption-key within the STACKIT-KMS to create encrypted volumes. These parameters never leave the backend again. So these parameters are not present on imports or in the datasource. They live only in your Terraform state after creation of the resource. (see below for nested schema)
  • labels (Map of String) Labels are key-value string pairs which can be attached to a resource container
  • name (String) The name of the volume.
  • performance_class (String) The performance class of the volume. Possible values are documented in Service plans BlockStorage
  • region (String) The resource region. If not defined, the provider region is used.
  • size (Number) The size of the volume in GB. It can only be updated to a larger value than the current size. Either size or source must be provided
  • source (Attributes) The source of the volume. It can be either a volume, an image, a snapshot or a backup. Either size or source must be provided (see below for nested schema)

Read-Only

  • encrypted (Boolean) Indicates if the volume is encrypted.
  • id (String) Terraform's internal resource ID. It is structured as "project_id,region,volume_id".
  • server_id (String) The server ID of the server to which the volume is attached to.
  • volume_id (String) The volume ID.

Nested Schema for encryption_parameters

Required:

  • kek_key_id (String) UUID of the key within the STACKIT-KMS to use for the encryption.
  • kek_key_version (Number) Version of the key within the STACKIT-KMS to use for the encryption.
  • kek_keyring_id (String) UUID of the keyring where the key is located within the STACKTI-KMS.
  • service_account (String) Service-Account linked to the Key within the STACKIT-KMS.

Optional:

  • key_payload_base64 (String, Sensitive) Optional predefined secret, which will be encrypted against the key-encryption-key within the STACKIT-KMS. If not defined, a random secret will be generated by the API and encrypted against the STACKIT-KMS. If a key-payload is provided here, it must be base64 encoded.
  • key_payload_base64_wo (String, Sensitive, Write-only) Optional predefined secret, which will be encrypted against the key-encryption-key within the STACKIT-KMS. If not defined, a random secret will be generated by the API and encrypted against the STACKIT-KMS. If a key-payload is provided here, it must be base64 encoded.
  • key_payload_base64_wo_version (Number) Used together with key_payload_base64_wo to trigger an re-create. Increment this value when an update to key_payload_base64_wo is required.

Nested Schema for source

Required:

  • id (String) The ID of the source, e.g. image ID
  • type (String) The type of the source. Possible values are: volume, image, snapshot, backup.