civo / terraform-provider-civo

Terraform Civo provider
https://www.civo.com
Mozilla Public License 2.0
65 stars 51 forks source link

[BUG] When using the data source for the civo_disk_image all subsequent applies keep asking to modify the same change #229

Open fernando-villalba opened 2 weeks ago

fernando-villalba commented 2 weeks ago

Description

When you apply the following:

terraform {
  required_providers {
    civo = {
      source = "civo/civo"
      version = "1.0.44"

    }
  }
}

data "civo_disk_image" "debian" {
   filter {
        key = "name"
        values = ["debian-10"]
   }
}

resource "civo_instance" "foo" {
    hostname = "blaha"
    tags = ["python", "nginx"]
    notes = "He perepepppppepepe "
    size = "g3.xsmall"
    disk_image = data.civo_disk_image.debian.diskimages[0].id
}

All subsequent applies, even if you don't change anything result in the following:

image

Acceptance criteria

Screenshots

No response

Additional information

No response

uzaxirr commented 1 week ago

I believe this is an issue with your terrafrom code instead of disk_image = data.civo_disk_image.debian.diskimages[0].id you should be using disk_image = data.civo_disk_image.debian.diskimages[0].name ID is meant to be used in the depreciated field template

fernando-villalba commented 1 week ago

@uzaxirr the code was grabbed from the documentation examples. Also even if this was the case, why did it work in the first place? If image id is not allowed it shouldn't work in the first place, so you could change that instead perhaps.