How to rename an IAM user

Use the below command to rename an IAM user from AWS CLI where oldusername is the current user name and newusername is the value for the new user name .

aws iam update-user --user-name oldusername --new-user-name newusername
See also  How to change the owner of a Redshift database