You must use the attribute sub. In fact, if a user with a username Ericodeletes his account, the new user may use the same username later, and the mapping will be incorrect ...
The username is always required to register the user and cannot be changed after the user is created.
However
The username must be unique within the user pool. The username can be reused, but only after it is deleted and is no longer used.
Update
sub as ID username as. username AdminGetUser.
username , , , " ", username .