How to use aws cli to set file permissions in an S3 bucket?

I am new to aws cli and I spent quite a lot of time in the documentation , but I cannot figure out how to set permissions on files after downloading them. Therefore, if I uploaded the file using

aws s3 cp assets/js/d3-4.3.0.js s3://example.example.com/assets/js/

and did not set access permissions, I need a way to set them. Is there an equivalent of chmod 644 in aws cli?

And in this regard, is there a way to view access rights?

I know that I could use the --acl public-read flag with aws s3 cp , but if I didnโ€™t, can I set access without repeating the full copy command?

+10
source share
1 answer

Awscli supports two groups of S3 actions: s3 and s3api .

You can use aws s3api put-object-acl to set ACL permissions for an existing object.

+17
source

Source: https://habr.com/ru/post/1261071/


All Articles