awslimitchecker.connectable module¶
-
class
awslimitchecker.connectable.
Connectable
[source]¶ Bases:
object
Mix-in helper class for connecting to AWS APIs. Centralizes logic of connecting via regions and/or STS.
-
__dict__
= mappingproxy({'__module__': 'awslimitchecker.connectable', '__doc__': '\n Mix-in helper class for connecting to AWS APIs. Centralizes logic of\n connecting via regions and/or STS.\n ', 'connect': <function Connectable.connect>, 'connect_resource': <function Connectable.connect_resource>, '__dict__': <attribute '__dict__' of 'Connectable' objects>, '__weakref__': <attribute '__weakref__' of 'Connectable' objects>})¶
-
__module__
= 'awslimitchecker.connectable'¶
-
__weakref__
¶ list of weak references to the object (if defined)
-
connect
()[source]¶ Connect to an AWS API via boto3 low-level client and set
self.conn
to the boto3.client object (abotocore.client.*
instance). Ifself.conn
is not None, do nothing. This connects to the API name given byself.api_name
.Returns: None
-
connect_resource
()[source]¶ Connect to an AWS API via boto3 high-level resource connection and set
self.resource_conn
to the boto3.resource object (aboto3.resources.factory.*.ServiceResource
instance). Ifself.resource_conn
is not None, do nothing. This connects to the API name given byself.api_name
.Returns: None
-
-
class
awslimitchecker.connectable.
ConnectableCredentials
(creds_dict)[source]¶ Bases:
object
boto’s (2.x)
boto.sts.STSConnection.assume_role()
returns aboto.sts.credentials.Credentials
object, but boto3’s boto3.sts.STSConnection.assume_role just returns a dict. This class provides a compatible interface for boto3.We also maintain an
account_id
attribute that can be set to the account ID, to ensure that credentials are updated when switching accounts.-
__dict__
= mappingproxy({'__module__': 'awslimitchecker.connectable', '__doc__': "\n boto's (2.x) :py:meth:`boto.sts.STSConnection.assume_role` returns a\n :py:class:`boto.sts.credentials.Credentials` object, but boto3's\n `boto3.sts.STSConnection.assume_role <https://boto3.readthedocs.org/en/\n latest/reference/services/sts.html#STS.Client.assume_role>`_ just returns\n a dict. This class provides a compatible interface for boto3.\n\n We also maintain an ``account_id`` attribute that can be set to the\n account ID, to ensure that credentials are updated when switching accounts.\n ", '__init__': <function ConnectableCredentials.__init__>, '__dict__': <attribute '__dict__' of 'ConnectableCredentials' objects>, '__weakref__': <attribute '__weakref__' of 'ConnectableCredentials' objects>})¶
-
__module__
= 'awslimitchecker.connectable'¶
-
__weakref__
¶ list of weak references to the object (if defined)
-