Redshift使用Grant或Canned ACL卸载

Kal*_*nam 5 amazon-s3 amazon-redshift

有没有办法从redshift执行卸载语句并传递固定ACL bucket-owner-full-control

Kal*_*nam 0

我最终得到了一个单独的 bash 脚本,它在 Redshift 创建的文件上添加了适当的 ACL。

S3_BUCKET="bla"
UNLOAD_FOLDER="path/to/bla"
for i in $(aws s3 ls s3://${S3_BUCKET}/${UNLOAD_FOLDER}/ --recursive | awk '{ print $4}');
    do  echo $i ;
        aws  s3api put-object-acl --bucket %s --region us-east-1 --key $i --acl bucket-owner-full-control;
    done
done
Run Code Online (Sandbox Code Playgroud)