You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/source/guide/s3-presigned-urls.rst
+13-4Lines changed: 13 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,7 +25,7 @@ A presigned URL remains valid for a limited period of time which is specified
25
25
when the URL is generated.
26
26
27
27
It is recommended to configure the S3 client with Signature Version 4
28
-
(``s3v4``) and the AWS region of the bucket when generating presigned URLs.
28
+
(``s3v4``), the AWS region of the bucket and to use virtual-hosted style addressing ``s3={'addressing_style': 'virtual'}`` when generating presigned URLs.
29
29
30
30
.. code-block:: python
31
31
@@ -51,7 +51,10 @@ It is recommended to configure the S3 client with Signature Version 4
51
51
s3_client = boto3.client(
52
52
's3',
53
53
region_name=region_name,
54
-
config=Config(signature_version='s3v4'),
54
+
config=Config(
55
+
signature_version='s3v4',
56
+
s3={'addressing_style': 'virtual'},
57
+
),
55
58
)
56
59
try:
57
60
response = s3_client.generate_presigned_url(
@@ -129,7 +132,10 @@ the appropriate method so this argument is not normally required.
129
132
s3_client = boto3.client(
130
133
's3',
131
134
region_name=region_name,
132
-
config=Config(signature_version='s3v4'),
135
+
config=Config(
136
+
signature_version='s3v4',
137
+
s3={'addressing_style': 'virtual'},
138
+
),
133
139
)
134
140
try:
135
141
response = s3_client.generate_presigned_url(
@@ -187,7 +193,10 @@ request and requires additional parameters to be sent as part of the request.
0 commit comments