Skip to content

Add vpc endpoint and nat gateways checks. #40

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions aws_quota/check/vpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,18 @@ def current(self):
return len(self.boto_session.client('ec2').describe_internet_gateways()['InternetGateways'])


class VpcEndpointCountCheck(QuotaCheck):
key = "vpc_endpoint"
description = "Gateway VPC endpoints per Region"
scope = QuotaScope.REGION
service_code = 'vpc'
quota_code = 'L-1B52E74A'

@property
def current(self):
return len(self.boto_session.client('ec2').describe_vpc_endpoints()['VpcEndpoints'])


class NetworkInterfaceCountCheck(QuotaCheck):
key = "ni_count"
description = "VPC network interfaces per Region"
Expand All @@ -105,6 +117,18 @@ def current(self):
return len(self.boto_session.client('ec2').describe_security_groups()['SecurityGroups'])


class NatGatewayCountCheck(QuotaCheck):
key = "nat_count"
description = "NAT gateways per Region"
scope = QuotaScope.REGION
service_code = 'vpc'
quota_code = 'L-FE5A380F'

@property
def current(self):
return len(self.boto_session.client('ec2').describe_nat_gateways()['NatGateways'])


class RulesPerSecurityGroupCheck(InstanceQuotaCheck):
key = "vpc_rules_per_sg"
description = "Rules per VPC security group"
Expand Down