this script automates the required update of temporary access credentials required when MFA is configured for aws cli authentication. it is meant to be run each time (cca once a day) the temporary tokens expired so it will renew them. it was tested on both linux and windows with python3. below is a short explanation on how to use.
let's assume you there is an aws profile named 'root' configured for access and you have enabled MFA for aws cli. Then you should add profile called root-mfa in both ~/.aws/config and ~/.aws/credentials as follows:
config
[profile root-mfa]
region = us-east-1