#Delete Amplify project without deleting Cognito

3 messages · Page 1 of 1 (latest)

low dawn
#

Hi there,

We are migrating away from AWS Amplify and would like to delete the Amplify projects, but I have not been able to find definitive information on how to delete the project without deleting the Cognito User Pools (there is one pool per environment - we have 3 environments). We do not want to delete these Cognito User Pools because we use them in our new deployment.

I've read about the amplify remove auth command that is meant to "unlink" the pool without deleting it, but looking around it seems people are saying that that command actually deletes the Cognito User Pools, so not sure whether that is the right way to go about it.

Would anybody know how to go about doing this?

wild kelp
#

Hi @low dawn, have you managed to remove auth without deleting the userpool? I can confirm that it actually amplify auth remove is deleting the cognito user pool.. I have now a similar issue where I can run amplify remove auth due to appsync dependency, and when I run amplify api remove, I get an error where appsync has dependency with a lambda function. Any news will be very helpful. thanks

low dawn
# wild kelp Hi <@807985747071860756>, have you managed to remove auth without deleting the ...

@wild kelp - I have given up trying to do that as it seems to risky. I am planning on leaving the Amplify project alone and will in the future copy the entire user pool to a brand new user pool (as it seems like that is possible with Lambda getting Cognito events as triggers).

The issue you are having is probably that your AppSync API is hooked up to Lambda Functions that implements the endpoints. You need to first delete those Lambda Functions and then delete the API as there is no cascading deletes (as in if you delete A but B depends on A and B still exists, Amplify will throw an error instead of deleting B in cascade).

To clean up my own project (since I could not delete it entirely due to not wanting to nuke our user pools), I deleted all the individual Lambda Functions I had (by doing amplify function remove) and then I deleted all the APIs I had (by doing amplify api remove). You just need to do the deletions in a particular order so that you first delete the things that nothing else depends on.