且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Codepipeline:权限不足无法使用 Amazon S3 对象密钥访问工件

更新时间:2022-04-18 21:22:26

我找到了解决方案.真正的问题是,当部署提供商设置为 Amazon ECS 时,我们需要生成一个输出工件,指示任务定义的名称和图像 uri,例如:

I was able to find a solution. The true issue is that when the deployment provider is set as Amazon ECS, we need to generate an output artifact indicating the name of the task definition and the image uri, for example:

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