opentelekomcloud / terraform-provider-opentelekomcloud

Terraform OpenTelekomCloud provider
https://registry.terraform.io/providers/opentelekomcloud/opentelekomcloud/latest
Mozilla Public License 2.0
87 stars 77 forks source link

[EVS] ignore_changes metadata.backupId not working #1514

Closed sfhl closed 3 years ago

sfhl commented 3 years ago

Hi there, after creating a new disk from a backup configured via terraform, we have to import the new disk into terraform in order to be able to use it furthermore. After doing so, terraform always wants to update the metadata.backupId attribute, because it does not know about it and it can't be given at import.

That causes a change everytime terraform runs, even if metadata.backupId is given in livecycle.ignore_changes.

Terraform provider version

Terraform v1.0.10
on linux_amd64
+ provider registry.terraform.io/terraform-providers/opentelekomcloud v1.26.0

Affected Resource(s)

Terraform Configuration Files

resource "opentelekomcloud_blockstorage_volume_v2" "evs-prod-test-1" {
  name              = "evs-prod-test-1"
  size              = "20"
  volume_type       = "SSD"
  device_type       = "VBD"
  availability_zone = "eu-de-01"

  metadata = {

    policy = "" ### dummy, needed for ignore_changes. backup is handled by evs_backup_plicy_v2

    attached_mode = "rw"
    readonly      = "False"
  }

  cascade = true

  lifecycle {
    ignore_changes = [metadata.policy, metadata.backupId]
  }
}

Steps to Reproduce

  1. terraform apply

Expected Behavior

metadata.backupId is ignored

Actual Behavior

Terraform wants to update metadata.backupId.

outcatcher commented 3 years ago

@sfhl Difference in metadata.policy should be ignored by the provider automatically. I will also add suppress of metadata.backupId diffs.

outcatcher commented 3 years ago

Should be fixed by #1533 but still requires testing in v1.26.2