AWS maintains service limits for each account to help ensure AWS resource availability and minimize billing risks for new customers. Some service limits will automatically increase gradually as you use AWS, but most AWS services require you to manually request limit increases.
How can I get more flexible service limits, and how can I manage my service limits according to scaling needs?
Solution
The AWS Limit Monitor solution automatically sets up necessary services to proactively track resource usage and send notifications when you approach limits. The solution is easy to deploy and leverages AWS Trusted Advisor service limit checks and service quotas to help you display usage and limits for specific AWS services, and centrally manage your limits.
With AWS Limit Monitor, you can receive notifications via email or Slack, allowing you to request limit increases or shut down resources before reaching limits.
AWS Limit Monitor Architecture
The solution uses AWS Lambda to automatically refresh AWS Trusted Advisor service limit checks to retrieve the latest utilization and limit data through API calls. Trusted Advisor calculates usage based on limits to determine whether the status is OK (usage below 80%), Warning (usage between 80% and 99%), or Error (usage at 100%).
If you choose to monitor Amazon Elastic Compute Cloud (Amazon EC2) based virtual central processor (vCPU-based) limits, the template launches another Lambda function that runs every five minutes. This function checks service quotas to retrieve vCPU usage and limit data for each AWS region. The function calculates vCPU usage based on limits to determine whether the status is "OK" (usage below 80%), "Warning" (usage between 80% and 99%), or "Error" (usage at 100%).
Amazon CloudWatch Events captures status events from Trusted Advisor and the vCPU monitoring Lambda function, and uses a set of CloudWatch Events rules to send status events to all targets you selected during the solution's initial deployment: Amazon Simple Queue Service (Amazon SQS) queue, Amazon Simple Notification Service (Amazon SNS) topic (optional), or Lambda function for Slack notifications (optional). If Slack notifications are enabled during initial deployment, the solution launches a Lambda function that sends notifications to your existing Slack.
CloudFormation template:
https://s3.amazonaws.com/solutions-reference/limit-monitor/latest/limit-monitor.template