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

[BUG] Wrong type stored in Terraform state for dynamic parameter #244

Open
TopeltR opened this issue Mar 26, 2025 · 1 comment
Open

[BUG] Wrong type stored in Terraform state for dynamic parameter #244

TopeltR opened this issue Mar 26, 2025 · 1 comment
Labels
bug Something isn't working

Comments

@TopeltR
Copy link

TopeltR commented Mar 26, 2025

What is the bug?

When creating an index using opensearch_index resource with dynamic parameter set to falsethe Terraform resource goes into an inconsistency loop. The value in the mapping provided to the TF resource is of type boolean but the value that is stored in Terraform state is of type string. This causes Terraform to apply the change every time it is executed regardless if the configuration changed.

I think the root cause for this inconsistency is that the OpenSearch returns the parameter value as a string when sending a request to GET testindex1/_mapping endpoint.

How can one reproduce the bug?

  1. Provision a new OpenSearch cluster
  2. Create a new index using the opensearch_index resource in the cluster and set the dynamic parameter to false
  3. Replan the project without any changes
  4. Terraform should ask to recreate the index because of type mismatch

What is the expected behavior?

The expected outcome is that when a mapping for dynamic field is applied the state no longer has the inconsistency and after initial apply it will not have changes unless the specified mapping changes.

What is your host/environment?

Opensearch Provider version 2.3.1
OpenSearch 2.17

@peterzhuamazon
Copy link
Member

Hi @prudhvigodithi could you take a look on this?

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: 🆕 New
Development

No branches or pull requests

2 participants