Amazon Cognito: CreateAdminUser
Jul 10, 2017 · 1 min read
A quick reminder for next time I use CreateAdminUser:
For new users:
- if
MessageActionis set toRESEND, creation will fail with aUserNotFoundException. - if
MessageActionis set toSUPPRESS, creation will succeed, and the email will be sent. - if
MessageActionis not included, creation will succeed, and the email will be sent.
For existing users:
- if
MessageActionis set toRESEND, the user record will be returned and the email will send.UserLastModifiedDatewill not equalUserCreateDate - if
MessageActionis set toSUPPRESS, aUsernameExistsExceptionis returned. - if
MessageActionis not included, aUsernameExistsExceptionis returned.
So, the default value is SUPPRESS. I want to error on existing users, so I can use the default. RESEND is only needed if I want to resend the confirmation, which I should set up a separate call: create_user vs resend_confirmation.
