AWS CLI - Rename IAM Username
CLI, IAM
AWS Console doesn't give ability to rename a user, to do so you need to use AWS CLI,
Powershell or AWS API.
Please visit AWS
CLI for download and setup instructions, I will be using Windows version for
this post.
AWS CLI Installation
aws --version
sample output: aws-cli/1.16.309 Python/3.6.0 Windows/10 botocore/1.13.45
AWS CLI Configuration
aws configure
AWS Access Key ID [None]: [PUT KEY ID]
AWS Secret Access Key [None]: [PUT ACCESS KEY]
Default region name [None]: [DEFAULT REGION]
Default output format [None]: text or json or table
Config information is saved in %userprofile%\.aws location in Windows. As a best practice create a new IAM user for performing these kind of operations instead of using 'Root' username aka god mode, in case you don't remember 'Secret Access Key' AWS console can generate a new one (it's generally a good idea to rotate keys periodically)
AWS CLI Rename Username
We will change the IAM User aws.john to aws.johndoe.
aws --profile default iam update-user --user-name aws.john --new-user-name aws.johndoe
No error message means command executed successfully
To verify rename aws --profile default iam get-user --user-name aws.johndoe