awslimitchecker.services.vpc module

class awslimitchecker.services.vpc._VpcService(warning_threshold, critical_threshold, boto_connection_kwargs={})[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:
  • warning_threshold (int) – the default warning threshold, as an integer percentage, for any limits without a specifically-set threshold.
  • critical_threshold (int) – the default critical threshold, as an integer percentage, for any limits without a specifically-set threshold.
  • profile_name (str) – The name of a profile in the cross-SDK shared credentials file for boto3 to retrieve AWS credentials from.
  • account_id (str) – AWS Account ID (12-digit string, currently numeric) for the account to connect to (destination) via STS
  • account_role (str) – the name of an IAM Role (in the destination account) to assume
  • region (str) – AWS region name to connect to
  • external_id (str) – (optional) the External ID string to use when assuming a role via STS.
  • mfa_serial_number (str) – (optional) the MFA Serial Number string to use when assuming a role via STS.
  • mfa_token (str) – (optional) the MFA Token string to use when assuming a role via STS.
__abstractmethods__ = frozenset([])
__module__ = 'awslimitchecker.services.vpc'
_abc_cache = <_weakrefset.WeakSet object>
_abc_negative_cache = <_weakrefset.WeakSet object>
_abc_negative_cache_version = 30
_abc_registry = <_weakrefset.WeakSet object>
_find_usage_ACLs()[source]

find usage for ACLs

_find_usage_gateways()[source]

find usage for Internet Gateways

_find_usage_nat_gateways(subnet_to_az)[source]

find usage for NAT Gateways

Parameters:subnet_to_az (dict) – dict mapping subnet ID to AZ
_find_usage_route_tables()[source]

find usage for route tables

_find_usage_subnets()[source]

find usage for Subnets; return dict of SubnetId to AZ

_find_usage_vpcs()[source]

find usage for VPCs

_find_usages_vpn_gateways()[source]

find usage of vpn gateways

api_name = 'ec2'
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 objects
Return 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 = 'VPC'