【发布时间】:2021-04-27 16:51:44
【问题描述】:
我在尝试将文件从 S3 存储桶复制到构建工件时遇到此错误,发布构建。
我的构建阶段错误日志说:
COMMAND_EXECUTION_ERROR: 执行命令时出错: aws s3 cp "s3://bucket/config.json" "config.json". Reason: exit status 1
这是我的 BuildSpec:
version: 0.2
phases:
install:
commands:
- npm install
build:
commands:
- npm run build
post_build:
commands:
- aws s3 cp "s3://bucket/config.json" "config.json"
【问题讨论】:
-
还有详细的日志吗?您是否为 CB 项目启用了 CloudWatch Logs?
-
我将启用 CloudWatch 日志,重新运行构建并在某个时间发布日志。现在,我想知道我们是否可以访问构建规范文件中的 aws cli?
-
是的,有 aws cli。立即想到的一件事情是,CB 角色是否有权访问您的 s3 存储桶和对象?
-
问题出在权限上!非常感谢,@Marcin。您可以将其发布为答案。
标签: amazon-s3 amazon-elastic-beanstalk aws-cli aws-codepipeline aws-codebuild