Open imanis opened 2 months ago
Please see if the comments from an issue from terraform repository helps
https://github.com/hashicorp/terraform/issues/31769#issuecomment-1243911229
https://github.com/hashicorp/terraform/issues/31769#issuecomment-1243987954
What is the bug?
When trying to delete a component_template
How can one reproduce the bug?
1- define opensearch_component_template.default-settings
2- define opensearch_composable_index_template.sample2-template that reference default-settings
3- run terraform apply and create resources
4- remove the definition of default-settings and its reference from the sample2-template
5- run terraform apply and you will get this error message:
module.component_template.opensearch_component_template.default-settings: Destroying... [id=default-settings] ╷ │ Error: elastic: Error 400 (Bad Request): component templates [default-settings] cannot be removed as they are still in use by index templates [sample2-template] [type=illegal_argument_exception]
What is the expected behavior?
A method to set destroy dependency between the 2 resources in order to update sample2-template before destroying default-settings
Do you have any additional context?
Plan of the step 5: