We try to keep logins to the AWS console to a minimum here. Automate as much as you can with PowerShell and CloudFormation, we say. Stay away from the UI, we say. Use the Visual Studio Toolkit if you must, using your access keys, we opine.
Well inevitably sometimes we end up forgetting our passwords when we do need to log into the AWS web console. And we have to reset our passwords.
There are a couple of ways round this. One, you can go grovelling to a colleague who has admin rights and ask them to help, or you can use your valid access keys.
Initialize-AWSDefaults -StoredCredentials storedcrednamehere
Update-IAMLoginProfile -UserName <username> -Password <password>
This of course opens a further can of worms over whether you’re handling your keys properly if you’re stupid enough to forget your password (as I was this morning), but let’s leave that for another day, because this is just a snippet. Let’s likewise leave alone the high-security practice of only granting yourself a password when you actually need it and then taking it away later. Because this is just a snippet.