This is a simple program that generates a session token for an AWS IAM user or assumes a role based on profiles. It differs from other similar programs in that it asks for input as you go. Once the token is generated, it's copied to the credentials file using the ini Go package.
Works on Windows! Thanks to https://github.com/fatih/color, coloring is easy to use and works perfectly in Windows, MacOS and Linux
This program assumes you have already configured your AWS config and credentials files (usually ~/.aws/config & ~/.aws/credentials)
~/.aws/credentials:
[default]
aws_access_key_id = AKXXXXXXXXXXXXXXXXXXXXX
aws_secret_access_key = XXXXXXXXXXXXXXXXXXXXXXXXX
~/.aws/config:
[profile myprofile]
mfa_serial = arn:aws:iam::AccountNumber:mfa/username
[profile myotherprofile]
role_arn = arn:aws:iam::1234567890:role/myrole
source_profile = default
mfa_serial = arn:aws:iam::AnotherAccountNumber:mfa/username
