Skip to content

Latest commit

 

History

History
52 lines (40 loc) · 1.43 KB

compute_volume_attach.md

File metadata and controls

52 lines (40 loc) · 1.43 KB
page_title subcategory description
t1_compute_volume_attach Resource - terraform-provider-t1
Provides an T1.Cloud Volume Attachment as a top level resource, to attach and detach volumes from T1.Cloud Instances.

t1_compute_volume_attach (Resource)

Provides an T1.Cloud Volume Attachment as a top level resource, to attach and detach volumes from T1.Cloud Instances.

Example Usage

resource "t1_compute_instance" "vm" {
  flavor = data.t1_compute_flavor.small
  image  = data.t1_compute_image.astra
  ssh_keys = [t1_compute_ssh_key.test.id]
  
  network_interface = {
    subnet_id = data.t1_vpc_network.default.subnets[0].id
  }
  system_volume = {
    size = 10
  }
}

resource "t1_compute_volume" "attached" {
  zone      = "ru-central1-a"
  name      = "test-attachments"
  size      = 5
  disk_type = "Basic"
}

resource "t1_compute_volume_attach" "attachment_block_example" {
  instance_id  = t1_compute_instance.vm.id
  volume_id    = t1_compute_volume.attached.id
}

Schema

Required

  • instance_id (String) ID of the Instance to attach to.
  • volume_id (String) ID of the Volume to be attached.

Optional

  • skip_destroy (Boolean) Use this flag if volume is attached to an instance, and will be deleted on instance termination. It's just remove the volume attachment from Terraform state.