https://github.com/omerh/autoscaling-lambda
AWS Autoscaling by SQS queues fast with no autoscaling policy using Lambda
https://github.com/omerh/autoscaling-lambda
autoscaling aws lambda python sqs
Last synced: 5 months ago
JSON representation
AWS Autoscaling by SQS queues fast with no autoscaling policy using Lambda
- Host: GitHub
- URL: https://github.com/omerh/autoscaling-lambda
- Owner: omerh
- Created: 2018-04-26T09:25:45.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-05-13T18:30:31.000Z (about 8 years ago)
- Last Synced: 2024-08-09T13:17:27.628Z (almost 2 years ago)
- Topics: autoscaling, aws, lambda, python, sqs
- Language: Python
- Homepage:
- Size: 7.81 KB
- Stars: 3
- Watchers: 2
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 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.
```
pairs = [{'queue_name': 'sqs_q1', 'autoscale_group': 'autoscale_group1'},
{'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
```bash
brew update
brew install awscli
aws configure (enter your aws credentials)
```
To start using the project run
Install pip on your mac and virtualenv
```bash
sudo easy_install pip
sudo pip install virtualenv
```
Create virtual env in your project
```bash
virtualenv venv
```
Activate virtualenv folder that just was created
```bash
. ./venv/bin/activate
```
To build a packed lambda zip file run
```bash
make install
make build
```
To deploy the lambda zip file to AWS run
```bash
make deploy
```
To update github
```bash
make git_update
```
### Logging
Default logging is DEBUG.
To modify it, add to lambda LOG_LEVEL environment variable with the level needed.