terraform-provider-opensearch
terraform-provider-opensearch copied to clipboard
Fix persistent delete of config_id (88)
Description
This change fixes a bug where the config_id
attribute was lost during the plan/diff phase even after being set correctly in the Read method. I have now fixed the issue by extracting the config_id
value from the API response to a temporary variable before setting the state. This avoids the issue caused by setting the state directly from the complex API response struct.
The fix ensures that the config_id
property is correctly persisted in the resource state between plans. Additionally, I have included optional handling for the body
attribute if defined in the schema to avoid hardcoding assumptions about the schema structure.
Issues Resolved
Closes [#88].
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license. For more information on following Developer Certificate of Origin and signing off your commits, please check here.
Hey @afrodidact can you please add some tests for this change? Thank you
Hi @prudhvigodithi, thanks for letting me know I missed the unit tests.
I haven't read that part of the code yet, so I will take some time over the coming days to familiarise myself with them, then alert you when I make my next commit.
Hey @afrodidact can you please update the PR with some unit tests? we can proceed to merge this PR. Thanks
Hi @prudhvigodithi, yes sorry for the delay. I am working on the unit tests and will try to update this soon.