2 years ago

#6062

test-img

dogTheCode

Export CODEARTIFACT_AUTH_TOKEN when MFA is enabled

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.

amazon-web-services

maven

ubuntu

aws-codeartifact

0 Answers

Your Answer

Accepted video resources