You can now activate deletion protection for your Amazon Cognito user pools. When you configure a user pool with deletion protection, the pool cannot be deleted by any user. Deletion protection is now active by default for new user pools created through the AWS Console. You can activate or deactivate deletion protection for an existing user pool in the AWS Console, the AWS Command Line Interface, and API. Deletion protection prevents you from requesting the deletion of a user pool unless you first modify the pool and deactivate deletion protection.
To configure deletion protection
- Go to the Amazon Cognito console. You might be prompted for your AWS credentials.
- Choose User Pools.
- Choose an existing user pool from the list, or create a user pool.
- Choose the User pool settings tab. Locate Deletion Protection and select Activate or Deactivate.
- Confirm your choice in the next dialogue.
When you want to delete a user pool with an Amazon Cognito API request, you must first change
Inactive in an UpdateUserPool request. If you don’t deactivate deletion protection, Amazon Cognito returns an
InvalidParameterException error. After you deactivate deletion protection, you can delete the user pool in a DeleteUserPool request.
Amazon Cognito activates Deletion protection by default when you create a new user pool. You can activate or deactivate deletion protection status in the Deletion protection container in the User pool settings tab in the Amazon Cognito console.
Refer- Cognito User Pool