Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Delete the user pool added by AWS Amplify

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?

like image 669
ataravati Avatar asked Mar 01 '20 02:03

ataravati


People also ask

How do I remove all users from Cognito?

You must have jq installed and remember to make the script executable: chmod +x deleteAllUsers.sh . The user pool id can be provided as a command line argument: ./deleteAllUsers.sh COGNITO_USER_POOL_ID . Thanks, this is perfect.

How do I change the attributes of an Amazon Cognito user pool after creation?

Short description. You can't change standard user pool attributes after a user pool is created. Instead, create a new user pool with the attributes that you want to require for user registration. Then, migrate existing users to the new user pool by using an AWS Lambda function as a user migration trigger.


2 Answers

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
like image 85
ataravati Avatar answered Oct 25 '22 03:10

ataravati


aws cognito-idp delete-user-pool --user-pool-id youruserpoolid
like image 30
bgibers Avatar answered Oct 25 '22 03:10

bgibers