Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

terraform detects in-place update: metadata is always set to null #14

Open
yildizbilal opened this issue Aug 8, 2022 · 1 comment
Open

Comments

@yildizbilal
Copy link

Current Behaviour
Upgraded from 7.12.2 to 7.16.2. We are deploying 5 watchers to kibana with the provider and just one of them uses the metadata flag. For the other 4 terraform tries to set the metadata value to null.

Expected Behaviour
Terraform shouldn't detect any updatable attributes and should show no changes detected.

Terraform Configuration

resource "elasticsearch_watcher" "alert" {
  name            = var.NAME
  trigger         = jsonencode(local.template.trigger)
  input           = jsonencode(local.template.input)
  condition       = jsonencode(local.template.condition)
  actions         = jsonencode(local.template.actions)
  metadata        = jsonencode(try(local.template.metadata, null))
  throttle_period = try(local.template.throttle_period, null)

  lifecycle {
    ignore_changes = [
      throttle_period
    ]
  }
}

Plan Output

[...]  

# module.watchers["redis-send-event-failed"].elasticsearch_watcher.alert will be updated in-place
  ~ resource "elasticsearch_watcher" "alert" {
        id        = "redis-send-event-failed"
      + metadata  = "null"
        name      = "redis-send-event-failed"
        # (4 unchanged attributes hidden)
    }

Plan: 0 to add, 4 to change, 0 to destroy.

Versions
Terraform: 1.2.3
disaster37/elasticsearch: 7.16.2

Workaround
Added metadata to the ignore_lifecycle lifecycle.

@disaster37
Copy link
Owner

Hi,

can you test with 8.4.0 release. If problem is still here, can you paste complete sample to reproduce it.
I can't play your sample because of I haven't your locals ...

Have a good day.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants