0
我在S3中擁有50多個存儲桶,並且希望爲所有存儲桶的「Authenticated Users」啓用「list」權限。如何在Linux命令行中執行此操作?在命令行中更新多個S3存儲桶權限
我在S3中擁有50多個存儲桶,並且希望爲所有存儲桶的「Authenticated Users」啓用「list」權限。如何在Linux命令行中執行此操作?在命令行中更新多個S3存儲桶權限
對於帳戶中的所有桶,這應該這樣做:
buckets=$(aws s3api list-buckets --query="Buckets[*].Name" --output=text)
for b in $buckets
do
echo "Adding List to AuthUsers on $b"
aws s3api put-bucket-acl \
--bucket $b \
--grant-read 'uri="http://acs.amazonaws.com/groups/global/AuthenticatedUsers"'
done
調整過濾器和權限,以你的情況,不作任何保證:)
更多S3 API命令,請參閱:http://docs.aws.amazon.com/cli/latest/reference/s3api/index.html
Linux還是windows? –
linux命令行 – Sathish