您好,我创建了一个具有以下配置的代码管道项目:
在尝试部署之前,所有过程都可以正常工作,由于某种原因,我在部署期间收到以下错误:
Insufficient permissions Unable to access the artifact with Amazon S3 object key 'FailedScanSubscriber/MyAppBuild/Wmu5kFy' located in the Amazon S3 artifact bucket 'codepipeline-us-west-2-913731893217'. The provided role does not have sufficient permissions.
在构建阶段,它甚至可以在 ECS 存储库中创建一个新的 docker 镜像。
我尝试了一切,更改了 IAM 角色和策略,添加了对 S3 的完全访问权限,我什至将 S3 存储桶设置为公开,但没有任何效果。我没有选择,如果有人可以帮助我,那就太好了,我对 AWS 的体验很差,所以任何帮助都是值得的。
最佳答案
我找到了解决方案。真正的问题是,当部署提供商设置为 Amazon ECS 时,我们需要生成一个输出工件,指示任务定义的名称和图像 uri,例如:
post_build:
commands:
- printf '[{"name":"your.task.definition.name","imageUri":"%s"}]' $AWS_ACCOUNT_ID.dkr.ecr.$AWS_DEFAULT_REGION.amazonaws.com/$IMAGE_REPO_NAME:$IMAGE_TAG > imagedefinitions.json
artifacts:
files: imagedefinitions.json
关于amazon-web-services - 代码管道 : Insufficient permissions Unable to access the artifact with Amazon S3 object key,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48955491/