Skip to content
This repository has been archived by the owner on Dec 18, 2022. It is now read-only.

Lambda function to publish the IP Address availability in all VPC-based subnets as CloudWatch Metrics.

License

Notifications You must be signed in to change notification settings

buzzsurfr/VpcSubnetIpMonitor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

VpcSubnetIpMonitor

UPDATE (2022-12-18): Archived as AWS now supports IP Address Management, rendering this unnecessary.

Lambda function to publish the IP Address availability in all VPC-based subnets as CloudWatch Metrics.

Built using AWS Serverless Application Model.

Preface

In AWS, private IP addresses are used with Elastic Network Interfaces (ENIs) to provide local routing for EC2 Instances, ECS/Fargate containers, Lambda Functions, RDS/Redshift databases, and more. It's important to right-size your subnets, but this is difficult to predict early in your application's lifecycle, and difficult to change later. Keeping track of IP address availability requires checking each subnet's AvailableIpAddressCount via a DescribeSubnets API call.

VpcSubnetIpMonitor is a Lambda function that can be deployed in an AWS account that will call the DescribeSubnets API and output custom CloudWatch Metrics, with the SubnetId as a dimension.

Metrics

  • AvailableIpAddressCount - Quantity of IP Addresses Available
  • TotalIpAddressCount - Quantity of Total IP Addresses in Subnet (based on CIDR size)
  • AvailableIpAddressPercent - Percentage of Available to Total IP Addresses

Deployment

Deploy using CloudFormation: Deploy to AWS

To deploy to AWS manually, see Create Your Own Serverless Application : Packaging and Deployment using this repository.

Once the function is running and reporting metrics, you can create CloudWatch Alarms for each subnet that alert if a subnet starts to reach its maximum capacity.

About

Lambda function to publish the IP Address availability in all VPC-based subnets as CloudWatch Metrics.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published