项目作者: omerh

项目描述 :
AWS Autoscaling by SQS queues fast with no autoscaling policy using Lambda
高级语言: Python
项目地址: git://github.com/omerh/autoscaling-lambda.git
创建时间: 2018-04-26T09:25:45Z
项目社区:https://github.com/omerh/autoscaling-lambda

开源协议:

下载


Lambda python based over autoscaling lambda

To use this function, activate by triggering a CloudWatch event.
The function will check by pairs SQS queue that you want an autoscale group to scale up.

  1. pairs = [{'queue_name': 'sqs_q1', 'autoscale_group': 'autoscale_group1'},
  2. {'queue_name': 'sqs_q2', 'autoscale_group': 'autoscale_group2'}]

When new SQS count >= Auto scale desired Count it will set a new desired count for the autoscale group

It will consider the MaxSize of the auto scale group as the max size regardless the amount of messages in the queue

Make sure to have aws cli installed

  1. brew update
  2. brew install awscli
  3. aws configure (enter your aws credentials)

To start using the project run
Install pip on your mac and virtualenv

  1. sudo easy_install pip
  2. sudo pip install virtualenv

Create virtual env in your project

  1. virtualenv venv

Activate virtualenv folder that just was created

  1. . ./venv/bin/activate

To build a packed lambda zip file run

  1. make install
  2. make build

To deploy the lambda zip file to AWS run

  1. make deploy

To update github

  1. make git_update

Logging

Default logging is DEBUG.
To modify it, add to lambda LOG_LEVEL environment variable with the level needed.