I am trying to refresh my session token under IAM profile with MFA authentification:
aws sts get-session-token
--duration-seconds $DURATION
--serial-number $AWS_SERIAL
--token-code $AWS_MFA ~/.aws/cli/cache/session.json
But, I got this error:
An error occurred (AccessDenied) when calling the GetSessionToken operation: Cannot call GetSessionToken with session credentials
My ARN is as below:
arn;aws:sts;XXXXX:assumed-role/YYYYYY/botoscore-session-ZZZZ
I looked over internet and were not able to find correct solution. Is there any direction that I should look.