Lambda function in node v16 that increases EBS Volume and resize filesystem. Slack integration included. SNS notification in case of failure.
Usage scenario:
- Grafana alarm triggers for e.g. 90% of disk usage.
- Contact point for this alarm is a WebSocket that points to AWS API Gateway.
- API Gateway authenticates request with Lambda Authorizer.
- API Gateway triggers Lambda function.
- EC2 instance and EBS Volumeis are identified based on request payload.
- Actual % usage of a disk is checked.
- EBS Volume is increased by specified value.
- Lambda waits for EBS Volume to not be in 'modifing' state.
- Filesystem is resized.
- New % usage of a disk is checked.