CodeArtifact setting error - sts:GetServiceBearerToken

0

I'm trying to set CodeArtifact so that I created domain and repository by manual. But whenever I put command line to access repo it give me back error message like below. Would you help me? I already add a "AWSCodeArtifactAdminAccess" permission on IAM Identity Center

Command line : aws codeartifact login --tool npm --repository npm-store --domain domain-npm --domain-owner 111111111 --region us-east-1

Error msg : when calling the GetAuthorizationToken operation: User: arn:aws:iam::111111111:root is not authorized to perform: sts:GetServiceBearerToken on resource: arn:aws:iam::111111111:root

Hi Im trying to set CodeArtifact so that I created domain and repository by manual. But whenever I put command line to access repo it give me back error message like below. Would you help me? I already add a "AWSCodeArtifactAdminAccess" permission on IAM Identity Center

Command line : aws codeartifact login --tool npm --repository npm-store --domain domain-npm --domain-owner 111111111 --region us-east-1

Error msg : when calling the GetAuthorizationToken operation: User: arn:aws:iam::111111111:root is not authorized to perform: sts:GetServiceBearerToken on resource: arn:aws:iam::111111111:root

haha
已提问 10 个月前736 查看次数
2 回答
0
已接受的回答

I solved it. I was trying to get access to codeartifact repo from EC2 without login(aws configure). I assigned a Access keys to a user account and then tried it again after login, it worked.

haha
已回答 10 个月前
0

The permission below is also given to a user on IAM Identity Center

{ "Version": "2012-10-17", "Statement": [ { "Action": [ "codeartifact:" ], "Effect": "Allow", "Resource": "" }, { "Effect": "Allow", "Action": "sts:GetServiceBearerToken", "Resource": "*", "Condition": { "StringEquals": { "sts:AWSServiceName": "codeartifact.amazonaws.com" } } } ] }

haha
已回答 10 个月前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则