{"id":13821090,"url":"https://github.com/brennerm/aws-quota-checker","last_synced_at":"2025-05-05T03:24:19.405Z","repository":{"id":44907154,"uuid":"342024836","full_name":"brennerm/aws-quota-checker","owner":"brennerm","description":"Keep an eye on your AWS quotas before you hit their limits","archived":false,"fork":false,"pushed_at":"2023-12-08T19:08:23.000Z","size":574,"stargazers_count":85,"open_issues_count":22,"forks_count":37,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-08-04T08:05:45.745Z","etag":null,"topics":["aws","ci","iac","quota"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/aws-quota-checker/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/brennerm.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-02-24T20:19:34.000Z","updated_at":"2024-08-04T08:05:48.417Z","dependencies_parsed_at":"2024-01-15T15:47:51.988Z","dependency_job_id":"8921a975-d4f1-4db8-a4c6-30435a5c6035","html_url":"https://github.com/brennerm/aws-quota-checker","commit_stats":{"total_commits":51,"total_committers":6,"mean_commits":8.5,"dds":"0.13725490196078427","last_synced_commit":"8d601258e995982dc19aa32b31b7c7a40ba7785e"},"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brennerm%2Faws-quota-checker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brennerm%2Faws-quota-checker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brennerm%2Faws-quota-checker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brennerm%2Faws-quota-checker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/brennerm","download_url":"https://codeload.github.com/brennerm/aws-quota-checker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225050786,"owners_count":17413241,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws","ci","iac","quota"],"created_at":"2024-08-04T08:01:15.018Z","updated_at":"2024-11-17T14:39:57.941Z","avatar_url":"https://github.com/brennerm.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# aws-quota-checker\n\nA tool that helps keeping track of your AWS quota utilization. It'll determine the limits of your AWS account and compare them to the number of current resources.\n\n![Example output of aws-quota-checker](https://raw.githubusercontent.com/brennerm/aws-quota-checker/master/img/example.png)\n\nThis is especially useful cause today, cloud resources are being created from all kinds of sources, e.g. IaC and Kubernetes operators. This tool will give you a head start for requesting quota increases before you hit a quota limit to prevent being stuck with a production system not being able to scale anymore.\n\nA usual use case is to add it to your CI pipeline right after applying your IaC or run it on a regular basis. It also comes with a Prometheus exporter mode that allows you to visualize the data with your tool of choice, e.g. Grafana.\n\n![Example Grafana dashboard that uses metrics of the Prometheus exporter](https://raw.githubusercontent.com/brennerm/aws-quota-checker/master/img/example-grafana-dashboard.png)\n\n## Installation\n\n### From pypi\n\n```bash\npip install aws-quota-checker\n```\n\n### From Docker\n\n```bash\ndocker run -e AWS_ACCESS_KEY_ID=ABC -e AWS_SECRET_ACCESS_KEY=DEF -e AWS_DEFAULT_REGION=eu-central-1 ghcr.io/brennerm/aws-quota-checker\n```\n\nor\n\n```bash\naws configure\ndocker run -v ~/.aws/credentials:/home/aqc/.aws/credentials:ro ghcr.io/brennerm/aws-quota-checker\n```\n\n### From source\n\n```bash\ngit clone git@github.com:brennerm/aws-quota-checker.git\ncd aws-quota-checker\npip install .\n```\n\n## Usage\n\nMake sure you are logged into your AWS account (`aws configure` or through environment variables) or switch to the one you want to check. This account needs to have read permissions for all supported services. AWS provides a default policy called _ReadOnlyAccess_ that contains the required permissions.\n\nCheck the help page with `aws-quota-checker --help` to see all available command and their documentation.\n\n### Run a single check\n\n```bash\n$ aws-quota-checker check vpc_count\nAWS profile: default | AWS region: eu-central-1 | Active checks: vpc_count\nVPCs per Region [default/eu-central-1]: 1/5 ✓\n```\n\n### Run all checks\n\n```bash\n$ aws-quota-checker check all\nAWS profile: default | AWS region: eu-central-1 | Active checks: route53_traffic_policy_count,vpc_count,ec2_tgw_count,ec2_on_demand_standard_count,route53_health_check_count,cw_alarm_count,iam_attached_policy_per_role,asg_count,elasticbeanstalk_environment_count,s3_bucket_count,iam_attached_policy_per_user,elb_listeners_per_alb,ec2_eip_count,route53resolver_rule_count,iam_policy_version_count,elb_listeners_per_nlb,vpc_subnets_per_vpc,route53_vpcs_per_hosted_zone,cf_stack_count,iam_user_count,elb_listeners_per_clb,ni_count,dyndb_table_count,elasticbeanstalk_application_count,route53_traffic_policy_instance_count,ig_count,elb_clb_count,ec2_vpn_connection_count,route53_reusable_delegation_set_count,ebs_snapshot_count,route53_hosted_zone_count,iam_attached_policy_per_group,eks_count,am_mesh_count,elb_target_group_count,route53resolver_rule_association_count,iam_server_certificate_count,elb_alb_count,vpc_acls_per_vpc,iam_group_count,ec2_spot_standard_count,route53resolver_endpoint_count,iam_policy_count,elb_nlb_count,sg_count,route53_records_per_hosted_zone,lc_count,ecs_count,secretsmanager_secrets_count\nCollecting checks  [####################################]  100%\nRoute53 Traffic Policies per Account [default]: 0/50 ✓\nVPCs per Region [default/eu-central-1]: 1/5 ✓\nTransit Gateways per Account [default]: 4/5 !\nRunning On-Demand Standard (A, C, D, H, I, M, R, T, Z) EC2 instances [default]: 0/1280 ✓\nRoute53 Health Checks per Account [default]: 0/200 ✓\nNumber of CloudWatch alarms per Region [default/eu-central-1]: 0/5000 ✓\nAuto Scaling groups per Region [default/eu-central-1]: 0/200 ✓\nElastic Beanstalk Environments per Account [default]: 0/200 ✓\nApplication Load Balancers per Region [default/eu-central-1]: 46/50 X\n...\n```\n\n### Run a single instance check\n\n```bash\n$ aws-quota-checker check-instance vpc_acls_per_vpc vpc-0123456789\nNetwork ACLs per VPC [default/eu-central-1/vpc-0123456789]: 0/200\n```\n\n### Prometheus exporter\n\nThe Prometheus exporter requires additional dependencies that you need to install with `pip install aws-quota-checker[prometheus]`.\n\n```bash\n$ aws-quota-checker prometheus-exporter all\nAWS profile: default | AWS region: us-east-1 | Active checks: am_mesh_count,asg_count,cf_stack_count,cw_alarm_count,dyndb_table_count,ebs_snapshot_count,ec2_eip_count,ec2_on_demand_f_count,ec2_on_demand_g_count,ec2_on_demand_inf_count,ec2_on_demand_p_count,ec2_on_demand_standard_count,ec2_on_demand_x_count,ec2_spot_f_count,ec2_spot_g_count,ec2_spot_inf_count,ec2_spot_p_count,ec2_spot_standard_count,ec2_spot_x_count,ec2_tgw_count,ec2_vpn_connection_count,ecs_count,eks_count,elasticbeanstalk_application_count,elasticbeanstalk_environment_count,elb_alb_count,elb_clb_count,elb_listeners_per_alb,elb_listeners_per_clb,elb_listeners_per_nlb,elb_nlb_count,elb_target_group_count,iam_attached_policy_per_group,iam_attached_policy_per_role,iam_attached_policy_per_user,iam_group_count,iam_policy_count,iam_policy_version_count,iam_server_certificate_count,iam_user_count,ig_count,lc_count,ni_count,route53_health_check_count,route53_hosted_zone_count,route53_records_per_hosted_zone,route53_reusable_delegation_set_count,route53_traffic_policy_count,route53_traffic_policy_instance_count,route53_vpcs_per_hosted_zone,route53resolver_endpoint_count,route53resolver_rule_association_count,route53resolver_rule_count,s3_bucket_count,secretsmanager_secrets_count,sg_count,sns_pending_subscriptions_count,sns_subscriptions_per_topic,sns_topics_count,vpc_acls_per_vpc,vpc_count,vpc_subnets_per_vpc\n09-Mar-21 20:15:11 [INFO] botocore.credentials - Found credentials in shared credentials file: ~/.aws/credentials\n09-Mar-21 20:15:11 [INFO] aws_quota.prometheus - starting /metrics endpoint on port 8080\n09-Mar-21 20:15:11 [INFO] aws_quota.prometheus - collecting checks\n09-Mar-21 20:15:19 [INFO] aws_quota.prometheus - collected 110 checks\n09-Mar-21 20:15:19 [INFO] aws_quota.prometheus - refreshing limits\n09-Mar-21 20:16:34 [INFO] aws_quota.prometheus - limits refreshed\n09-Mar-21 20:16:34 [INFO] aws_quota.prometheus - refreshing current values\n09-Mar-21 20:18:15 [INFO] aws_quota.prometheus - current values refreshed\n```\n\nThe exporter will return the following metrics:\n\n- awsquota_$checkkey: the current value of each quota check\n- awsquota_$checkkey_limit: the limit value of each quota check\n- awsquota_$checkkey_duration_seconds: the time to get the current value of each quota check\n- awsquota_$checkkey_limit_duration_seconds: the time to get the limit value of each quota check\n- awsquota_check_count: the number of quota checks that are being executed\n- awsquota_check_limits_duration_seconds: the number of seconds that was necessary to query all quota limits\n- awsquota_check_currents_duration_seconds: the number of seconds that was necessary to query all current quota values\n- awsquota_info: info gauge that will expose the current AWS account and region as labels\n\nDepending on the check type, labels for the AWS account, the AWS region and the instance ID will be attached to the metric.\n\nBelow you can find a few example metrics:\n\n```\n# HELP awsquota_info AWS quota checker info\n# TYPE awsquota_info gauge\nawsquota_info{account=\"123456789\",region=\"us-east-1\"} 1.0\n# HELP awsquota_check_count Number of AWS Quota Checks\n# TYPE awsquota_check_count gauge\nawsquota_check_count 110.0\n# HELP awsquota_collect_checks_duration_seconds Time to collect all quota checks\n# TYPE awsquota_collect_checks_duration_seconds gauge\nawsquota_collect_checks_duration_seconds{account=\"123456789\",region=\"us-east-1\"} 7.885610818862915\n# HELP awsquota_asg_count_limit Auto Scaling groups per Region Limit\n# TYPE awsquota_asg_count_limit gauge\nawsquota_asg_count_limit{account=\"123456789\",region=\"us-east-1\"} 200.0\n# HELP awsquota_ec2_on_demand_standard_count Running On-Demand Standard (A, C, D, H, I, M, R, T, Z) EC2 instances\n# TYPE awsquota_ec2_on_demand_standard_count gauge\nawsquota_ec2_on_demand_standard_count{account=\"123456789\"} 22.0\n# HELP awsquota_elb_listeners_per_clb Listeners per Classic Load Balancer\n# TYPE awsquota_elb_listeners_per_clb gauge\nawsquota_elb_listeners_per_clb{account=\"123456789\",instance=\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\",region=\"us-east-1\"} 10.0\nawsquota_elb_listeners_per_clb{account=\"123456789\",instance=\"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\",region=\"us-east-1\"} 2.0\n```\n\nAs querying all quotas, depending on the number of resources to check, may take some time, the exporter works asynchronously. That means requesting the /metrics endpoint will return cached results and not trigger a recheck of all quotas. Instead all checks will be executed and refreshed in the background. That's why no metrics will be available directly after starting the exporter.\n\nHence it doesn't make too much sense to scrape the /metrics every few seconds cause the values will only refresh once in a while. The check intervals of the background jobs can be adjusted to your needs using command line arguments.\n\n## Autocompletion\n\nTo enable autocompletion for all check keys, sub commands and their options, follow one of the next sections depending on the shell you use.\n\n### Bash\n\nAdd this to your _~/.bashrc_:\n\n`eval \"$(_AWS_QUOTA_CHECKER_COMPLETE=source_bash aws-quota-checker)\"`\n\n### Zsh\n\nAdd this to your _~/.zshrc_:\n\n`eval \"$(_AWS_QUOTA_CHECKER_COMPLETE=source_zsh aws-quota-checker)\"`\n\n### Fish\n\nAdd this to your _~/.config/fish/completions/aws-quota-checker.fish_:\n\n`eval \"$(_AWS_QUOTA_CHECKER_COMPLETE=source_fish aws-quota-checker)\"`\n\n## Missing a quota check?\n\nFeel free to create a new issue with the _New Check_ label including a description which quota check you are missing.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrennerm%2Faws-quota-checker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrennerm%2Faws-quota-checker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrennerm%2Faws-quota-checker/lists"}