Skip to content

Commit b10f3a8

Browse files
committed
add acl where needed, update docs
1 parent b37e145 commit b10f3a8

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

docs/S3Storage.rst

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,9 @@ Using credentials with the awscli
102102
---------------------------------
103103
This example illustrates obtaining STS credentials and using them with the awscli command line tool.
104104
The first command outputs the credentials as shell commands to execute which will then be picked up
105-
by subsequent aws cli commands.
105+
by subsequent aws cli commands. Note that the bucket-owner-full-control ACL is required when putting
106+
an object via STS credentials. This ensures that the object ownership will be transferred to the
107+
owner of the AWS bucket.
106108

107109
.. code-block::
108110
@@ -116,12 +118,14 @@ by subsequent aws cli commands.
116118
# if the above are executed in the shell, the awscli will automatically apply them
117119
118120
# e.g. copy a file directly to the bucket using the exported credentials
119-
$ aws s3 cp /path/to/local/file $SYNAPSE_STS_S3_LOCATION
121+
$ aws s3 cp /path/to/local/file $SYNAPSE_STS_S3_LOCATION --acl bucket-owner-full-control
120122
121123
Using credentials with boto3 in python
122124
--------------------------------------
123125
This example illustrates retrieving STS credentials and using them with boto3 within python code,
124-
in this case to upload a file.
126+
in this case to upload a file. Note that the bucket-owner-full-control ACL is required when putting
127+
an object via STS credentials. This ensures that the object ownership will be transferred to the
128+
owner of the AWS bucket.
125129

126130
.. code-block::
127131
@@ -133,6 +137,7 @@ in this case to upload a file.
133137
Filename='/path/to/local/file,
134138
Bucket='my-external-synapse-bucket',
135139
Key='path/within/bucket/file',
140+
ExtraArgs={'ACL': 'bucket-owner-full-control'},
136141
)
137142
138143
Automatic transfers to/from STS storage locations using boto3 with synapseclient

tests/integration/synapseclient/core/test_external_storage.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ def test_sts_external_storage_location(self):
155155
Filename=temp_file.name,
156156
Bucket=bucket_name,
157157
Key=remote_key,
158+
ExtraArgs={'ACL': 'bucket-owner-full-control'},
158159
)
159160

160161
# now read the file using our read credentials

0 commit comments

Comments
 (0)