6

I'm developing a React Native app and using AWS Amplify with Amazon Cognito for authentication. I've added the authentication for the app using Amplify CLI (amplify add auth). The problem is I need to add/remove the required attributes for the sign up, but those cannot be changed after the user pool is created.

My question is how can I delete the currently added user pool using the CLI, and making sure that the changes are reflected in aws-exports.js?

ataravati
  • 8,891
  • 9
  • 57
  • 89

2 Answers2

11

I figured it out. As mentioned here, it's not in amplify-cli docs, but you can remove a single category (in this case auth) like this:

amplify remove <category>

So, in this case, it would be

amplify remove auth

And, then

amplify push
ataravati
  • 8,891
  • 9
  • 57
  • 89
1
aws cognito-idp delete-user-pool --user-pool-id youruserpoolid
ataravati
  • 8,891
  • 9
  • 57
  • 89
bgibers
  • 200
  • 10
  • Do I need to do `amplify pull` after this? – ataravati Mar 01 '20 at 02:41
  • You may be able to create a new user pool manually and then link it to your Amplify like this outlines https://medium.com/@danielcender/use-a-custom-cognito-user-pool-with-aws-appsync-3d0c82f3010b . I'm not too sure they support an out of the box way of switching user pools – bgibers Mar 01 '20 at 02:51
  • https://stackoverflow.com/questions/60098978/how-to-change-aws-cognito-user-pools-in-an-angular-app-to-another-user-pool-usi?rq=1 – bgibers Mar 01 '20 at 02:52