jasperagrante
jasperagrante

Reputation: 354

Cognito User Pool doesn't Retain users

Changing Cognito User Pool schema that's provisioned with DeletionPolicy: Retain using serverless deletes the whole user pool. But adding a custom attribute using the console isn't destructive.

Upvotes: 4

Views: 1184

Answers (1)

Ionut Trestian
Ionut Trestian

Reputation: 5751

Modifying the schema requires replacement with cloudformation which will delete and recreate your pool: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cognito-userpool.html#cfn-cognito-userpool-schema

The update code isn't advanced enough to detect that you added a user attribute and call the AddCustomAttributes api, it only can modify things accessible to the UpdateUserPool api. If you need to add a new attribute, you should either use the command line or the console to do it if you have previously created the pool.

UserPoolClient also requires replacement when some attributes are modified. http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cognito-userpoolclient.html Can you provide more details on what you changed if anything when it tried to delete your client? A stack arn would be the most useful if you can send it via private message.

Upvotes: 2

Related Questions