PATH:
usr
/
local
/
jetapps
/
var
/
lib
/
aws
/
lib
/
python2.7
/
site-packages
/
awscli
/
examples
/
s3api
The example below sets the logging policy for *MyBucket*. The AWS user *user@example.com* will have full control over the log files, and all users will have access to them. First, grant S3 permission with ``put-bucket-acl``:: aws s3api put-bucket-acl --bucket MyBucket --grant-write URI=http://acs.amazonaws.com/groups/s3/LogDelivery --grant-read-acp URI=http://acs.amazonaws.com/groups/s3/LogDelivery Then apply the logging policy:: aws s3api put-bucket-logging --bucket MyBucket --bucket-logging-status file://logging.json ``logging.json`` is a JSON document in the current folder that contains the logging policy:: { "LoggingEnabled": { "TargetBucket": "MyBucket", "TargetPrefix": "MyBucketLogs/", "TargetGrants": [ { "Grantee": { "Type": "AmazonCustomerByEmail", "EmailAddress": "user@example.com" }, "Permission": "FULL_CONTROL" }, { "Grantee": { "Type": "Group", "URI": "http://acs.amazonaws.com/groups/global/AllUsers" }, "Permission": "READ" } ] } } .. note:: the ``put-bucket-acl`` command is required to grant S3's log delivery system the necessary permissions (write and read-acp permissions).
[-] put-bucket-policy.rst
[edit]
[-] delete-bucket.rst
[edit]
[-] put-bucket-notification-configuration.rst
[edit]
[-] delete-bucket-website.rst
[edit]
[-] put-bucket-logging.rst
[edit]
[+]
..
[-] list-buckets.rst
[edit]
[-] delete-objects.rst
[edit]
[-] list-object-versions.rst
[edit]
[-] delete-bucket-lifecycle.rst
[edit]
[-] complete-multipart-upload.rst
[edit]
[-] list-parts.rst
[edit]
[-] get-bucket-website.rst
[edit]
[-] put-bucket-lifecycle.rst
[edit]
[-] get-bucket-tagging.rst
[edit]
[-] list-multipart-uploads.rst
[edit]
[-] get-bucket-location.rst
[edit]
[-] get-bucket-cors.rst
[edit]
[-] delete-object.rst
[edit]
[-] put-object-acl.rst
[edit]
[-] copy-object.rst
[edit]
[-] upload-part.rst
[edit]
[-] put-bucket-replication.rst
[edit]
[-] create-bucket.rst
[edit]
[-] put-bucket-cors.rst
[edit]
[-] get-object.rst
[edit]
[-] abort-multipart-upload.rst
[edit]
[-] put-bucket-website.rst
[edit]
[-] get-object-torrent.rst
[edit]
[-] delete-bucket-replication.rst
[edit]
[-] delete-bucket-cors.rst
[edit]
[-] get-bucket-acl.rst
[edit]
[-] head-object.rst
[edit]
[-] head-bucket.rst
[edit]
[-] get-bucket-lifecycle.rst
[edit]
[-] get-bucket-policy.rst
[edit]
[-] delete-bucket-tagging.rst
[edit]
[-] put-object.rst
[edit]
[-] get-bucket-notification-configuration.rst
[edit]
[-] put-bucket-notification.rst
[edit]
[-] delete-bucket-policy.rst
[edit]
[-] put-bucket-lifecycle-configuration.rst
[edit]
[-] put-bucket-versioning.rst
[edit]
[-] put-bucket-tagging.rst
[edit]
[-] get-bucket-versioning.rst
[edit]
[-] create-multipart-upload.rst
[edit]
[-] get-bucket-notification.rst
[edit]
[-] put-bucket-acl.rst
[edit]
[-] get-object-acl.rst
[edit]
[-] list-objects.rst
[edit]
[-] get-bucket-replication.rst
[edit]
[-] get-bucket-lifecycle-configuration.rst
[edit]