terraform-provider-vultr icon indicating copy to clipboard operation
terraform-provider-vultr copied to clipboard

allow attaching block off instances

Open ddymko opened this issue 2 years ago • 1 comments

Description

This PR will allow you to attach block storage from instances. This works well but does cause a little bit of drift but gets cleaned up on a apply or refresh. We will need to update the docs saying that this can be a bit drifty and it may be recommended to only use this if you must and if you do to ignore the attached_instance_to field on block.

Here is an example tf

resource "vultr_block_storage" "my_blockstorage" {
    size_gb = 10
    region = "ewr"
}


resource "vultr_block_storage" "bs2" {
    size_gb = 10
    region = "ewr"
}


resource "vultr_block_storage" "bs3" {
    size_gb = 10
    region = "ewr"
}


resource "vultr_instance" "prod-1" {
  region = "ewr"
  plan = "vhf-1c-2gb"
  os_id = 167
  block_storage_ids = [vultr_block_storage.bs2.id]
}

Once we test this a bit more I'll update the docs portion for instances

Related Issues

#176

Checklist:

  • [x] Have you checked to ensure there aren't other open Pull Requests for the same update/change?
  • [x] Have you linted your code locally prior to submission?
  • [x] Have you successfully ran tests with your changes locally?

ddymko avatar Feb 16 '22 00:02 ddymko

@optik-aper Please remove me from reviewers on this 🙏🏻

Oogy avatar Oct 31 '23 14:10 Oogy