1

I am logged in with AWS Access Key ID and AWS Secret Access Key in the terminal. But when i am running the command:

export CODEARTIFACT_AUTH_TOKEN=`aws codeartifact get-authorization-token --domain XXXXXXXXXXX --domain-owner XXXXXXXXXXXX --query authorizationToken --output text``

I get the following error:

An error occurred (AccessDeniedException) when calling the GetAuthorizationToken operation: User: arn:aws:iam::XXXXXXXXXXXX:user/XXXXXXXXXXX is not authorized to perform: codeartifact:GetAuthorizationToken on resource: arn:aws:codeartifact:eu-north-1:XXXXXXXXXXX:domain/XXXXXXXXXX with an explicit deny in an identity-based policy

MFA is enabled on my AWS account.

  1. Do i have to log in with MFA in terminal? If so, how?
  2. Do i have to add a policy? if so, how?

I appreciate any help on this issue as i'm new to AWS and trying to learn the ropes.

dogTheCode
  • 11
  • 2
  • Did you checkout https://stackoverflow.com/questions/34795780/how-to-use-mfa-with-aws-cli ? – st.huber Jan 11 '22 at 15:02
  • Does this answer your question? [How to use MFA with AWS CLI?](https://stackoverflow.com/questions/34795780/how-to-use-mfa-with-aws-cli) – st.huber Jan 11 '22 at 15:02

0 Answers0