awslimitchecker.services.ec2 module¶
-
class
awslimitchecker.services.ec2.
_Ec2Service
(warning_threshold, critical_threshold)[source]¶ Bases:
awslimitchecker.services.base._AwsService
Describes an AWS service and its limits, and provides methods to query current utilization.
Constructors of _AwsService subclasses must not make any external connections; these must be made lazily as needed in other methods. _AwsService subclasses should be usable without any external network connections.
Parameters: -
__abstractmethods__
= frozenset([])¶
-
__module__
= 'awslimitchecker.services.ec2'¶
-
_abc_cache
= <_weakrefset.WeakSet object>¶
-
_abc_negative_cache
= <_weakrefset.WeakSet object>¶
-
_abc_negative_cache_version
= 25¶
-
_abc_registry
= <_weakrefset.WeakSet object>¶
-
_get_limits_instances
()[source]¶ Return a dict of limits for EC2 instances only. This method should only be used internally by :py:meth:~.get_limits`.
Return type: dict
-
_get_limits_networking
()[source]¶ Return a dict of VPC-related limits only. This method should only be used internally by :py:meth:~.get_limits`.
Return type: dict
-
_get_reserved_instance_count
()[source]¶ For each availability zone, get the count of current instance reservations of each instance type. Return as a nested dict of AZ name to dict of instance type to reservation count.
Return type: dict
-
_instance_types
()[source]¶ Return a list of all known EC2 instance types
Returns: list of all valid known EC2 instance types Return type: list
-
_instance_usage
()[source]¶ Find counts of currently-running EC2 Instances (On-Demand or Reserved) by placement (Availability Zone) and instance type (size). Return as a nested dict of AZ name to dict of instance type to count.
Return type: dict
-
find_usage
()[source]¶ Determine the current usage for each limit of this service, and update corresponding Limit via
_add_current_usage()
.
-
get_limits
()[source]¶ Return all known limits for this service, as a dict of their names to
AwsLimit
objects.Returns: dict of limit names to AwsLimit
objectsReturn type: dict
-
required_iam_permissions
()[source]¶ Return a list of IAM Actions required for this Service to function properly. All Actions will be shown with an Effect of “Allow” and a Resource of “*”.
Returns: list of IAM Action strings Return type: list
-
service_name
= 'EC2'¶
-