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

Replica index can't be deleted #103

Closed
k-yomo opened this issue May 23, 2022 · 1 comment · Fixed by #170
Closed

Replica index can't be deleted #103

k-yomo opened this issue May 23, 2022 · 1 comment · Fixed by #170

Comments

@k-yomo
Copy link
Owner

k-yomo commented May 23, 2022

Currently we can't delete virtual index from terraform.
It seems like the API issue, since it can't be deleted from the other clients too.
algolia/algoliasearch-client-javascript#1377

NOTE:

Workaround would be deleting replica from console, and remove from the state with terraform state rm.

Terraform Version

  • Terraform version: v1.0.0
  • Provider version: v0.5.0

Affected Resource(s)

  • algolia_index
  • algolia_virtual_index

Terraform Configuration Files

# algolia_index.example_replica will be destroyed
- resource "algolia_index" "example_replica" {
    - id                     = "test" -> null
    - name                   = "test" -> null
    - virtual                = false -> null
    ...
}

Expected Behavior

Replica index should be deleted when we delete a replica index resource.

Actual Behavior

We'll get the following error.

Algolia API error [403] cannot apply a add object request on a replica index

Steps to Reproduce

Deleting replica index resource.

Important Factoids

References

@k-yomo k-yomo changed the title replica index can't be deleted Replica index can't be deleted May 23, 2022
@dotSource-bke
Copy link

We saw that the replica indices have to be unlinked from the primary index before atempting to delete them.
Still we were not able to do this "manually" by reapplying the primary without the replica to delete and then atempting to delete the replica. Even worse, when deleting indices that are linked to replicas, instead of becomming independend indices, the replicas drop into an orphaned state, where it is impossible to delete them (as they still count as replica) but also impossible to unlink (as the primary is gone). We needed to relink the replicas to a primary and then unlink using a different method than terraform.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants