# This MFA authentication script will add temporary access keys to your credentials file plus an additional AWS Session Token which is valid for a maximum of 12 hours.
# Pass parameters in like so... temporary profile must already exist with region configured in your CLI profile. See example in docs.
echo"If having issues with this script please see example ~/.aws/credentials file for setup @ https://repo1.dso.mil/big-bang/bigbang/-/blob/add-aws-mfa-scripting-to-k3d-dev/docs/assets/scripts/developer/mfa-aws-creds-example"
while[$# -gt 0 ];do
if[[$1==*"--"*]];then
param="${1/--/}"
declare$param="$2"
# echo $1 $2 # Optional to see the parameter:value result
fi
shift
done
if[${#token}-ne 6 ];then
echo"Please provide a six digit token code with --token <token-code>"