Closed joaoolavobv closed 1 year ago
Sorry, my mistake. Removing the template section and moving settings and mappings to upper lever (as showed bellow), it worked fine.
resource "opensearch_index_template" "index_template" {
for_each = toset(local.apps_file)
name = "${each.key}"
body = jsonencode(
{
index_patterns = [
"${each.key}-*"
]
mappings = {
properties = {}
}
settings = {
index = {
number_of_shards = "1"
}
}
}
)
}
What is the bug?
I've a opensearch_index_template resource. Applying the plan, it creates the resource correctly on my AWS OpenSearch 2.5 domain. If I run plan/apply again, it keeps saying that this resourse will be updated.
How can one reproduce the bug?
Here's a part of the terraform file:
I also defined the "body" part as bellow, and the behavor is the same:
After apply, the template is there:
And if I run plan/apply again, and again, I always get:
What is the expected behavior?
Nothing to do after the first apply.
What is your host/environment?
Do you have any additional context?
I use the for_each loop in order to create a resource per application listed on a file. It creates correctly internal users, roles and role mappings, no issue on these.