【发布时间】:2020-05-22 16:44:46
【问题描述】:
我有 2 个 AWS 账户。让我们说 A 和 B。
账户 A 使用 CodeBuild 构建工件并将其上传到 B 拥有的 S3 存储桶。B 账户已为存储桶设置 ACL 权限,以便向 A 授予写入权限。
工件文件已成功上传到 S3 存储桶。但是,B 帐户对该文件没有任何权限,因为该文件归 A 所有。
账户A可以通过运行改变所有权
aws s3api put-object-acl --bucket bucket-name --key key-name --acl bucket-owner-full-control
但这必须在每次从 A 帐户构建后手动运行。如何通过 CodeBuild 程序向账户 B 授予权限?或者帐户 B 如何覆盖此所有权权限错误。
CodeBuild 使用 web-hooks 自动启动,我的构建规范是这样的:
version: 0.2
env:
phases:
install:
runtime-versions:
java: openjdk8
commands:
- echo Entered the install phase...
build:
commands:
- echo Entered the build phase...
post_build:
commands:
- echo Entered the post_build phase...
artifacts:
files:
- 'myFile.txt'
【问题讨论】:
标签: amazon-web-services amazon-s3 acl aws-codebuild