Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot Delete Amazon Cognito User Pool with DeletionProtection enabled #477

Closed
benriou opened this issue Dec 26, 2024 · 1 comment · Fixed by #478
Closed

Cannot Delete Amazon Cognito User Pool with DeletionProtection enabled #477

benriou opened this issue Dec 26, 2024 · 1 comment · Fixed by #478
Labels

Comments

@benriou
Copy link

benriou commented Dec 26, 2024

aws-nuke could not delete a given user-pool resulting a permanent error.

Version : aws-nuke version v3.38.0

************ - CognitoUserPool - doctrine-users-dev-2 - [ID: "eu-central-1_qqRfNd1uC", Name: "doctrine-users-dev-2"] - failed
ERRO[0053] InvalidParameterException: All attributes in AttributesRequireVerificationBeforeUpdate must exist in AutoVerifiedAttributes 
FATA[0053] failed                                       

I could reproduce the error.
I had to peform the deletion-protection call manually by specifying explicitely the required settings as shown :

❯ aws cognito-idp update-user-pool --user-pool-id eu-central-1_qqRfNd1uC --user-attribute-update-settings='AttributesRequireVerificationBeforeUpdate=email' --auto-verified-attributes='email' --deletion-protection INACTIVE

Then the cognito-idp user-pool-deletion succeeded

❯ aws cognito-idp delete-user-pool --user-pool-id eu-central-1_qqRfNd1uC

The issue is located here where the user-attribute-update-settings and auto-verified-attributes need to be set.

I'm not confident enough to be able to present a PR by myself.

You can reproduce the issue by creating a cognito-user-pool from the AWS Console (then the deletion protection is automatically set), then attempting to delete it via aws-nuke.

@ekristen
Copy link
Owner

🎉 This issue has been resolved in version 3.38.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants