从S3复制文件时出现AWSCodeBuild错误-COMMAND_EXECUTION_ERROR:原因:退出状态1(NodeJS)
我在尝试将文件从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"
回答
根据评论。
该问题是由 CodeBuld 角色无权访问 S3 引起的。因此,为了解决这个问题,需要将 S3 的权限添加到角色中。
THE END
二维码