-
Notifications
You must be signed in to change notification settings - Fork 133
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
elasticsearch_xpack_index_lifecycle_policy always triggers update #277
Comments
Hello, can you please include the following:
|
Terraform: v1.0.7
(File content):
|
I get the same issue with this provider v2.0.1, and ES cluster 8.2.1 Found a workaround (requires terraform >= 1.2.0) It set ignore_changes on body, Meanwhile, this does not reconcile if value have changed on Elasticsearch without modification on code side. locals {
indices = {
"foo" = {"policy":{"phases":{"hot":{"actions":{"rollover":{"max_age":"10d"}}}}}}
"bar" = {"policy":{"phases":{"hot":{"actions":{"rollover":{"max_age":"20d"}}}}}}
}
}
resource "elasticsearch_xpack_index_lifecycle_policy" "main" {
for_each = local.indices
name = each.key
body = jsonencode(each.value)
lifecycle {
ignore_changes = [body]
replace_triggered_by = [null_resource.index_lifecycle_policy_trigger[each.key]]
}
}
resource "null_resource" "index_lifecycle_policy_trigger" {
for_each = local.indices
triggers = {
body = jsonencode(each.value)
}
} EDIT: it's not working once policy is attached to an index
|
Hi all - a fix for this is in 44db200, trying to get the tests up to date to reflect this. |
Fixed in b1d58ff |
I'm using v2.0.4 of this provider, and although these non-static fields are not triggering "will be updated" they are still being flagged as "has been changed" (see example below) - is there a way for the same Plan output: Click to expand
Terraform: Click to expand
I realise that |
elasticsearch_xpack_index_lifecycle_policy always triggers an update, as the returned GET json contains extra element (in_use_by) not required in the POST json:
The text was updated successfully, but these errors were encountered: