2

我无法将策略分配给我在 AWS 代码工件中创建的存储库。

我收到一条错误消息策略文档不是有效的策略文档

请帮助我解决我哪里出错了。

域名 = avc
仓库名称 = code-repo-maven-SNAPSHOT

{
   "Version":"2012-10-17",
   "Statement":[
      {
         "Action":[
            "codeartifact:*"
         ],
         "Effect":"Allow",
         "Resource":"arn:aws:codeartifact:us-east-1:130000006255:repository/avc/code-repo-maven-SNAPSHOT"
      },
      {
         "Effect":"Allow",
         "Action":"sts:GetServiceBearerToken",
         "Resource":"*",
         "Condition":{
            "StringEquals":{
               "sts:AWSServiceName":"codeartifact.amazonaws.com"
            }
         }
      }
   ]
}```
4

1 回答 1

3

存储库策略是基于资源的策略。这意味着它应该有校长。 欲了解更多信息

    {
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Principal": {
                "AWS": "arn:aws:iam::130000006255:root"
            },
            "Action": "codeartifact:*",
            "Resource": "arn:aws:codeartifact:us-east-1:130000006255:repository/avc/code-repo-maven-SNAPSHOT"
        }
    ]
}
于 2020-08-09T22:17:01.003 回答