amplify-category-api
amplify-category-api copied to clipboard
Dropping a dynamo table doesn't delete the opensearch index associated to it
How did you install the Amplify CLI?
yarn
If applicable, what version of Node.js are you using?
18.16.0
Amplify CLI Version
12.3.0
What operating system are you using?
windows
Did you make any manual changes to the cloud resources managed by Amplify? Please describe the changes made.
No
Describe the bug
When a table that utilizes the "@searchable" attribute and contains data is deleted, the associated OpenSearch index is not removed. Furthermore, the documents within the index persist even after the table has been removed.
Expected behavior
Opensearch index should be removed or at least emptied
Reproduction steps
create a graphql api
create a table
add @searchable to the model table
add data to the dynaomdb table
delete the table
the opensearch index associated to the table should be deleted (or emptied at least)
Project Identifier
No response
Log output
# Put your logs below this line
Additional information
No response
Before submitting, please confirm:
- [X] I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
- [X] I have removed any sensitive information from my code snippets and submission.
@adeldueast, thank you for creating this issue after coming to our Discord Office Hours! We'll get this reviewed internally and comment with further questions or updates as we have them.
@AnilMaktala Can you try to reproduce this behavior and verify if we're actually not clearing the index?
Hey @adeldueast, We are currently attempting to replicate the issue. Could you kindly provide clarification on the method you are using to delete the table?
Well ideally I would just update my table and amplify push using --allow-destructive-graphql-schema-updates. This should delete the table and create the new one (with the changes)
But since this doesnt really work... I manually have to comment out the table, amplify push with --allow-destructive-graphql-schema-updates. Then uncomment the table with the new changes and amplify push again.
Hey @adeldueast, Thank you for clarification. We have successfully reproduced the issue using the provided steps, so we will categorize this as a bug for the team to investigate further.