Skip to content

Lambda Control-Plane to scale-up/down Auto Scaling Group using schedule event

License

Notifications You must be signed in to change notification settings

melvinlee/lambda-cp-asg

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Control-Plane AutoScalingGroup

This Lambda function control-plane can scale-up or scale-down aws auto scaling group automatically by specific a given schedule.

Quick Start

Setup and deploy

Let's deploy this function using Serverless framework.

1st, install serverless framework:

$ npm install -g serverless

Set-up your AWS Provider Credentials

$ aws configure

Deploy

In order to deploy the function simply run

$ serverless deploy

Trigger

Simple add or remove cloudwatch schedule event in the serverless.yml with the required parameters: AsgGroupName, MinSize and DesiredCapacity

For example:

functions:
  scale-asg:
    events:
     - schedule:
          description: 'Scale-Down: Schedule at 7pm GMT+8 Mon-Fri'
          rate: cron(0 11 ? * MON-FRI *)
          enabled: true
          input:
            AsgGroupName: sitapp-AutoScaleGrp-XL7APL96YQPQ
            MinSize: 0
            DesiredCapacity: 0
     - schedule:
          description: 'New event'
          ...

About

Lambda Control-Plane to scale-up/down Auto Scaling Group using schedule event

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages