I understand your confusion regarding Cognito and the attributes required for a User. It is important to note that regardless of how you want the User to sign in or sign up for your User Pool, each user must have an immutable Username. That required Username serves as a unique identifier for each User in a User Pool.
preferred_username when not required is an alias, an attribute that can be used in place of the Username when signing in which is why it is easily changeable. Because Username is an immutable element that needs to be uniquely defined, I would not recommend redefining it to equal a static variable.
Feel free to reach out if you have any other questions.
cognito pre-signupasked 2 years ago
How to prevent Cognito sign up from exposing user email existence?asked 7 months ago
Can we make username=sub?
How can I appeal out of sand box rejection? and what is verified email??asked a month ago
Can I create relationship from User pool to table in DynamoDB?asked 3 years ago
Unconfirmed email in cognito userpoolasked 8 days ago
How to use preferred username to login a user?
need to reliably get new user's sub during pre sign-up triggerasked 3 years ago
Allow a user to fix phone_number attribute during signUp()asked 2 years ago
For AWS Marketplace publication, can an SaaS products collect user's emailasked a year ago