Open sentinelleader opened 2 years ago
Hello, can you please include the following:
Maybe related, we have the same problem when using elasticsearch_opendistro_ism_policy
and elasticsearch_opendistro_monitor
In the case of elasticsearch_opendistro_ism_policy
, the ism_template
part is always displayed as a change set
resource "elasticsearch_opendistro_ism_policy" "ism_policy" {
for_each = var.ism_policies
body = each.value
policy_id = each.key
}
{
"policy": {
"description": "Policy for log indices.",
"default_state": "hot",
"ism_template": {
"index_patterns": ["*"],
"priority": 0
},
"states": []
}
}
# module.log_cluster.elasticsearch_opendistro_ism_policy.ism_policy["default"] will be updated in-place
~ resource "elasticsearch_opendistro_ism_policy" "ism_policy" {
~ body = jsonencode(
~ {
~ policy = {
~ ism_template = [
- {
- index_patterns = [
- "*",
]
- priority = 0
},
] -> {
+ index_patterns = [
+ "*",
]
+ priority = 0
}
# (3 unchanged elements hidden)
}
}
)
id = "default"
# (3 unchanged attributes hidden)
}
Also seeing this on elasticsearch_composable_index_template. It finds changes in the index pattern and index settings when there are none.
Terraform v1.2.7 AWS OpenSearch Service 1.3 provider version 2.0.4
~ body = jsonencode(
~ {
~ index_patterns = [
- "j2735_*",
] -> "j2735_*"
~ template = {
~ settings = {
~ index = {
~ number_of_replicas = "2" -> 2
~ number_of_shards = "1" -> 1
}
}
# (1 unchanged element hidden)
}
# (3 unchanged elements hidden)
}
)
id = ""
name = ""
}
Hello @phillbaker! Fist of all, thank you very much for the great work you are doing on this provider!
Our team also seeing a similar issue with the elasticsearch_index_template
resource.
~ resource "elasticsearch_index_template" "index_template" {
~ body = jsonencode(
~ {
+ aliases = {}
+ mappings = {}
+ order = 0
# (2 unchanged elements hidden)
}
)
id = "template-a"
name = "template-a"
}
We are using Terraform v1.3.7 AWS OpenSearch Service 1.3 provider version 2.0.7
Happy to provide more information if needed. Also will be glad to assist in resolving this issue if it's a known one.
I've seen a couple different issues here, might help someone else facing similar issues (as I was)
number_of_replicas = "2" -> 2
- your configuration is using a string, while the refreshed state has a number. Simply update your body to use the matching types.
Hello we are using v2.0.2 release and even in the previous releases we are seeing perpetual change for elasticsearch_index_template resource on everny terraform plan. Plan shows we are trying to set it to null (see the below plan output)
Is this related to https://github.com/phillbaker/terraform-provider-elasticsearch/issues/93 ?