Skip to content

Commit

Permalink
[V2] Replaced /MyBucket/ with amzn-s3-demo-bucket (#9243)
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] authored Jan 22, 2025
1 parent c560b1c commit b887216
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion awscli/examples/s3api/put-bucket-acl.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
This example grants ``full control`` to two AWS users (*[email protected]* and *[email protected]*) and ``read``
permission to everyone::

aws s3api put-bucket-acl --bucket MyBucket --grant-full-control [email protected],[email protected] --grant-read uri=http://acs.amazonaws.com/groups/global/AllUsers
aws s3api put-bucket-acl --bucket amzn-s3-demo-bucket --grant-full-control [email protected],[email protected] --grant-read uri=http://acs.amazonaws.com/groups/global/AllUsers

See http://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUTacl.html for details on custom ACLs (the s3api ACL
commands, such as ``put-bucket-acl``, use the same shorthand argument notation).
Expand Down
2 changes: 1 addition & 1 deletion awscli/examples/s3api/put-bucket-cors.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
The following example enables ``PUT``, ``POST``, and ``DELETE`` requests from *www.example.com*, and enables ``GET``
requests from any domain::

aws s3api put-bucket-cors --bucket MyBucket --cors-configuration file://cors.json
aws s3api put-bucket-cors --bucket amzn-s3-demo-bucket --cors-configuration file://cors.json

cors.json:
{
Expand Down
20 changes: 10 additions & 10 deletions awscli/examples/s3api/put-bucket-logging.rst
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
**Example 1: To set bucket policy logging**

The following ``put-bucket-logging`` example sets the logging policy for *MyBucket*. First, grant the logging service principal permission in your bucket policy using the ``put-bucket-policy`` command. ::
The following ``put-bucket-logging`` example sets the logging policy for *amzn-s3-demo-bucket*. First, grant the logging service principal permission in your bucket policy using the ``put-bucket-policy`` command. ::

aws s3api put-bucket-policy \
--bucket MyBucket \
--bucket amzn-s3-demo-bucket \
--policy file://policy.json

Contents of ``policy.json``::
Expand All @@ -16,7 +16,7 @@ Contents of ``policy.json``::
"Effect": "Allow",
"Principal": {"Service": "logging.s3.amazonaws.com"},
"Action": "s3:PutObject",
"Resource": "arn:aws:s3:::MyBucket/Logs/*",
"Resource": "arn:aws:s3:::amzn-s3-demo-bucket/Logs/*",
"Condition": {
"ArnLike": {"aws:SourceARN": "arn:aws:s3:::SOURCE-BUCKET-NAME"},
"StringEquals": {"aws:SourceAccount": "SOURCE-AWS-ACCOUNT-ID"}
Expand All @@ -28,14 +28,14 @@ Contents of ``policy.json``::
To apply the logging policy, use ``put-bucket-logging``. ::

aws s3api put-bucket-logging \
--bucket MyBucket \
--bucket amzn-s3-demo-bucket \
--bucket-logging-status file://logging.json

Contents of ``logging.json``::

{
"LoggingEnabled": {
"TargetBucket": "MyBucket",
"TargetBucket": "amzn-s3-demo-bucket",
"TargetPrefix": "Logs/"
}
}
Expand All @@ -46,26 +46,26 @@ For more information, see `Amazon S3 Server Access Logging <https://docs.aws.ama

**Example 2: To set a bucket policy for logging access to only a single user**

The following ``put-bucket-logging`` example sets the logging policy for *MyBucket*. The AWS user *[email protected]* will have full control over
The following ``put-bucket-logging`` example sets the logging policy for *amzn-s3-demo-bucket*. The AWS user *[email protected]* will have full control over
the log files, and no one else has any access. First, grant S3 permission with ``put-bucket-acl``. ::

aws s3api put-bucket-acl \
--bucket MyBucket \
--bucket amzn-s3-demo-bucket \
--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 using ``put-bucket-logging``. ::

aws s3api put-bucket-logging \
--bucket MyBucket \
--bucket amzn-s3-demo-bucket \
--bucket-logging-status file://logging.json

Contents of ``logging.json``::

{
"LoggingEnabled": {
"TargetBucket": "MyBucket",
"TargetPrefix": "MyBucketLogs/",
"TargetBucket": "amzn-s3-demo-bucket",
"TargetPrefix": "amzn-s3-demo-bucket-logs/",
"TargetGrants": [
{
"Grantee": {
Expand Down
10 changes: 5 additions & 5 deletions awscli/examples/s3api/put-bucket-policy.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
This example allows all users to retrieve any object in *MyBucket* except those in the *MySecretFolder*. It also
This example allows all users to retrieve any object in *amzn-s3-demo-bucket* except those in the *MySecretFolder*. It also
grants ``put`` and ``delete`` permission to the root user of the AWS account ``1234-5678-9012``::

aws s3api put-bucket-policy --bucket MyBucket --policy file://policy.json
aws s3api put-bucket-policy --bucket amzn-s3-demo-bucket --policy file://policy.json

policy.json:
{
Expand All @@ -10,13 +10,13 @@ grants ``put`` and ``delete`` permission to the root user of the AWS account ``1
"Effect": "Allow",
"Principal": "*",
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::MyBucket/*"
"Resource": "arn:aws:s3:::amzn-s3-demo-bucket/*"
},
{
"Effect": "Deny",
"Principal": "*",
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::MyBucket/MySecretFolder/*"
"Resource": "arn:aws:s3:::amzn-s3-demo-bucket/MySecretFolder/*"
},
{
"Effect": "Allow",
Expand All @@ -27,7 +27,7 @@ grants ``put`` and ``delete`` permission to the root user of the AWS account ``1
"s3:DeleteObject",
"s3:PutObject"
],
"Resource": "arn:aws:s3:::MyBucket/*"
"Resource": "arn:aws:s3:::amzn-s3-demo-bucket/*"
}
]
}
Expand Down
2 changes: 1 addition & 1 deletion awscli/examples/s3api/put-object-acl.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
The following command grants ``full control`` to two AWS users (*[email protected]* and *[email protected]*) and ``read``
permission to everyone::

aws s3api put-object-acl --bucket MyBucket --key file.txt --grant-full-control [email protected],[email protected] --grant-read uri=http://acs.amazonaws.com/groups/global/AllUsers
aws s3api put-object-acl --bucket amzn-s3-demo-bucket --key file.txt --grant-full-control [email protected],[email protected] --grant-read uri=http://acs.amazonaws.com/groups/global/AllUsers

See http://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUTacl.html for details on custom ACLs (the s3api ACL
commands, such as ``put-object-acl``, use the same shorthand argument notation).

0 comments on commit b887216

Please sign in to comment.