boto3 1.36.26__py3-none-any.whl → 1.37.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- boto3/__init__.py +1 -1
- boto3/docs/__init__.py +1 -1
- boto3/session.py +38 -3
- {boto3-1.36.26.dist-info → boto3-1.37.0.dist-info}/METADATA +2 -2
- {boto3-1.36.26.dist-info → boto3-1.37.0.dist-info}/RECORD +9 -9
- {boto3-1.36.26.dist-info → boto3-1.37.0.dist-info}/LICENSE +0 -0
- {boto3-1.36.26.dist-info → boto3-1.37.0.dist-info}/NOTICE +0 -0
- {boto3-1.36.26.dist-info → boto3-1.37.0.dist-info}/WHEEL +0 -0
- {boto3-1.36.26.dist-info → boto3-1.37.0.dist-info}/top_level.txt +0 -0
boto3/__init__.py
CHANGED
boto3/docs/__init__.py
CHANGED
@@ -24,7 +24,7 @@ def generate_docs(root_dir, session):
|
|
24
24
|
text files documenting each service.
|
25
25
|
|
26
26
|
:param root_dir: The directory to write the reference files to. Each
|
27
|
-
service's reference documentation is
|
27
|
+
service's reference documentation is located at
|
28
28
|
root_dir/reference/services/service-name.rst
|
29
29
|
|
30
30
|
:param session: The boto3 session
|
boto3/session.py
CHANGED
@@ -16,7 +16,11 @@ import os
|
|
16
16
|
|
17
17
|
import botocore.session
|
18
18
|
from botocore.client import Config
|
19
|
-
from botocore.exceptions import
|
19
|
+
from botocore.exceptions import (
|
20
|
+
DataNotFoundError,
|
21
|
+
NoCredentialsError,
|
22
|
+
UnknownServiceError,
|
23
|
+
)
|
20
24
|
|
21
25
|
import boto3
|
22
26
|
import boto3.utils
|
@@ -44,6 +48,8 @@ class Session:
|
|
44
48
|
:type profile_name: string
|
45
49
|
:param profile_name: The name of a profile to use. If not given, then
|
46
50
|
the default profile is used.
|
51
|
+
:type aws_account_id: string
|
52
|
+
:param aws_account_id: AWS account ID
|
47
53
|
"""
|
48
54
|
|
49
55
|
def __init__(
|
@@ -54,6 +60,7 @@ class Session:
|
|
54
60
|
region_name=None,
|
55
61
|
botocore_session=None,
|
56
62
|
profile_name=None,
|
63
|
+
aws_account_id=None,
|
57
64
|
):
|
58
65
|
if botocore_session is not None:
|
59
66
|
self._session = botocore_session
|
@@ -74,9 +81,22 @@ class Session:
|
|
74
81
|
if profile_name is not None:
|
75
82
|
self._session.set_config_variable('profile', profile_name)
|
76
83
|
|
77
|
-
|
84
|
+
creds = (
|
85
|
+
aws_access_key_id,
|
86
|
+
aws_secret_access_key,
|
87
|
+
aws_session_token,
|
88
|
+
aws_account_id,
|
89
|
+
)
|
90
|
+
if any(creds):
|
91
|
+
if self._account_id_set_without_credentials(
|
92
|
+
aws_account_id, aws_access_key_id, aws_secret_access_key
|
93
|
+
):
|
94
|
+
raise NoCredentialsError()
|
78
95
|
self._session.set_credentials(
|
79
|
-
aws_access_key_id,
|
96
|
+
aws_access_key_id,
|
97
|
+
aws_secret_access_key,
|
98
|
+
aws_session_token,
|
99
|
+
aws_account_id,
|
80
100
|
)
|
81
101
|
|
82
102
|
if region_name is not None:
|
@@ -224,6 +244,7 @@ class Session:
|
|
224
244
|
aws_secret_access_key=None,
|
225
245
|
aws_session_token=None,
|
226
246
|
config=None,
|
247
|
+
aws_account_id=None,
|
227
248
|
):
|
228
249
|
"""
|
229
250
|
Create a low-level service client by name.
|
@@ -291,6 +312,10 @@ class Session:
|
|
291
312
|
<https://botocore.amazonaws.com/v1/documentation/api/latest/reference/config.html>`_
|
292
313
|
for more details.
|
293
314
|
|
315
|
+
:type aws_account_id: string
|
316
|
+
:param aws_account_id: The account id to use when creating
|
317
|
+
the client. Same semantics as aws_access_key_id above.
|
318
|
+
|
294
319
|
:return: Service client instance
|
295
320
|
|
296
321
|
"""
|
@@ -305,6 +330,7 @@ class Session:
|
|
305
330
|
aws_secret_access_key=aws_secret_access_key,
|
306
331
|
aws_session_token=aws_session_token,
|
307
332
|
config=config,
|
333
|
+
aws_account_id=aws_account_id,
|
308
334
|
)
|
309
335
|
|
310
336
|
def resource(
|
@@ -527,3 +553,12 @@ class Session:
|
|
527
553
|
event_emitter=self.events,
|
528
554
|
),
|
529
555
|
)
|
556
|
+
|
557
|
+
def _account_id_set_without_credentials(
|
558
|
+
self, account_id, access_key, secret_key
|
559
|
+
):
|
560
|
+
if account_id is None:
|
561
|
+
return False
|
562
|
+
elif access_key is None or secret_key is None:
|
563
|
+
return True
|
564
|
+
return False
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: boto3
|
3
|
-
Version: 1.
|
3
|
+
Version: 1.37.0
|
4
4
|
Summary: The AWS SDK for Python
|
5
5
|
Home-page: https://github.com/boto/boto3
|
6
6
|
Author: Amazon Web Services
|
@@ -23,7 +23,7 @@ Classifier: Programming Language :: Python :: 3.13
|
|
23
23
|
Requires-Python: >= 3.8
|
24
24
|
License-File: LICENSE
|
25
25
|
License-File: NOTICE
|
26
|
-
Requires-Dist: botocore (<1.
|
26
|
+
Requires-Dist: botocore (<1.38.0,>=1.37.0)
|
27
27
|
Requires-Dist: jmespath (<2.0.0,>=0.7.1)
|
28
28
|
Requires-Dist: s3transfer (<0.12.0,>=0.11.0)
|
29
29
|
Provides-Extra: crt
|
@@ -1,8 +1,8 @@
|
|
1
|
-
boto3/__init__.py,sha256=
|
1
|
+
boto3/__init__.py,sha256=LxcgzIvx6r3ZSJYFtCsEjWjp7LNjMZdNFLT36wb2r7U,3419
|
2
2
|
boto3/compat.py,sha256=1T-LvBYqd0z-L9hI-soU7O7v-678tyWWR2pztF055u0,2887
|
3
3
|
boto3/crt.py,sha256=VFstUtHMZrZ6eHJJ-YdXb4vqfIOcHbv1l51fdeY5cS0,5407
|
4
4
|
boto3/exceptions.py,sha256=i13QpGxoFizxAGCzA2qmF9ldbI5IfBpn37DH75ddRF8,4127
|
5
|
-
boto3/session.py,sha256=
|
5
|
+
boto3/session.py,sha256=mEk9ystkkF6UQYtGJQ9EJ5OL8PNbrbArVDYEnF1bX8w,21717
|
6
6
|
boto3/utils.py,sha256=dBw0Eu23TOhDsP1Lkrp4uOVMn5DS8s0kRGwVRiCD_KM,3141
|
7
7
|
boto3/data/cloudformation/2010-05-15/resources-1.json,sha256=5mFVKJVtbVoHyPdHSyNfZ5mpkgCAws5PhnveSu4qzdI,5110
|
8
8
|
boto3/data/cloudwatch/2010-08-01/resources-1.json,sha256=q4AgE8F4pbscd-2U3NYSGAzK55zpMyOQGr83JUxbZXI,11690
|
@@ -20,7 +20,7 @@ boto3/data/opsworks/2013-02-18/resources-1.json,sha256=Y6ygEyegsbYA1gGZn-Ad2yuDd
|
|
20
20
|
boto3/data/s3/2006-03-01/resources-1.json,sha256=VeKALhMRqv7fyDHMLOM5_RzXUEuDdg_n6OIRi3sdB-o,37204
|
21
21
|
boto3/data/sns/2010-03-31/resources-1.json,sha256=7zmKQhafgsRDu4U1yiw3NXHz-zJhHKrOmtuoYlxQP-s,9091
|
22
22
|
boto3/data/sqs/2012-11-05/resources-1.json,sha256=LRIIr5BId3UDeuBfLn-vRiWsSZCM9_ynqdxF8uzHgy8,6545
|
23
|
-
boto3/docs/__init__.py,sha256=
|
23
|
+
boto3/docs/__init__.py,sha256=xEUfkpfz3nGn8-siOf_Q1dqPuPGP_WpUGVCtfnJ-XGc,1844
|
24
24
|
boto3/docs/action.py,sha256=mCW9IUvZS1eStA0DrSqD1B_hZBz6YTdrQmbI5d2Jzbo,8122
|
25
25
|
boto3/docs/attr.py,sha256=BnG3tR1KKQvvY58aeJiWQ5W5DiMnJ_9jUjmG6tDbFiU,2500
|
26
26
|
boto3/docs/base.py,sha256=nOrQSCeUSIZPkn-I59o7CfjEthgdkpCt_rXtE9zQnXc,2103
|
@@ -55,9 +55,9 @@ boto3/s3/__init__.py,sha256=GkSq-WxXWfVHu1SEcMrlJbzkfw9ACgF3UdCL6fPpTmY,562
|
|
55
55
|
boto3/s3/constants.py,sha256=ZaYknNwqGwsJEGkL92GXaBs9kjfRbyCDFt89wei8t7E,690
|
56
56
|
boto3/s3/inject.py,sha256=Bg_eVSG2uHL9sqGSoVZuBURNHidVj5NMTULQmX63FtM,28551
|
57
57
|
boto3/s3/transfer.py,sha256=_0Xxoycr7CiUbLtSoPeRP8cjK7yYHnmDIm59CQPYDAs,15935
|
58
|
-
boto3-1.
|
59
|
-
boto3-1.
|
60
|
-
boto3-1.
|
61
|
-
boto3-1.
|
62
|
-
boto3-1.
|
63
|
-
boto3-1.
|
58
|
+
boto3-1.37.0.dist-info/LICENSE,sha256=DVQuDIgE45qn836wDaWnYhSdxoLXgpRRKH4RuTjpRZQ,10174
|
59
|
+
boto3-1.37.0.dist-info/METADATA,sha256=IjQhwGIHJx4Bdy-J_nMWh8brQb3UotLLciQ5hxeRYTU,6649
|
60
|
+
boto3-1.37.0.dist-info/NOTICE,sha256=BPseYUhKeBDxugm7QrwByljJrzOSfXxaIVVuTE0cf6Q,83
|
61
|
+
boto3-1.37.0.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
|
62
|
+
boto3-1.37.0.dist-info/top_level.txt,sha256=MP6_SI1GcPseXodd3Ykt5F_mCBsrUksiziLxjEZKGUU,6
|
63
|
+
boto3-1.37.0.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|