-
Notifications
You must be signed in to change notification settings - Fork 57
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
[BUG] opensearch_index number_of_replicas is optional but breaks on subsequent applies if unset #52
Labels
bug
Something isn't working
Comments
[Triage] Adding @prudhvigodithi to take a look on this. |
Hey @arichtman-srt can you please test with the latest release? https://registry.terraform.io/providers/opensearch-project/opensearch/2.0.0-beta.1 |
Tested today with 2.1.0 and no working with this example:
# Create an index template
resource "opensearch_index_template" "logs_1" {
name = "logs_1"
body = <<EOF
{
"index_patterns": [ "logs*" ],
"template": {
"settings": {
"index": {
"number_of_shards": "1",
"number_of_replicas": "0",
"refresh_interval": "5s"
}
}
}
}
EOF
}
# Create a simple index
resource "opensearch_index" "logs-01" {
name = "logs-01"
}
as output
|
As a workaround # Create a simple index
resource "opensearch_index" "logs-01" {
name = "logs-01"
lifecycle {
ignore_changes = [
number_of_replicas,
refresh_interval
]
}
}
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What is the bug?
Terraform tries to set the number of replicas back to null, which will never work.
How can one reproduce the bug?
opensearch_index
type and set the only required property,name
number_of_replicas
number_of_replicas
tonull
What is the expected behavior?
Either:
A) It's possible to set replica count to nothing, in which case Terraform does so
B) Number of replicas property should be mandatory
What is your host/environment?
Do you have any screenshots?
Do you have any additional context?
Technically it's correct that replica count isn't required to create an index. But I'm no software philosopher.
The text was updated successfully, but these errors were encountered: