asger is a tool designed to field notifications from Amazon EC2 auto-scaling groups via a SNS topic subscribed to an SQS queue. (Which probably sounds alarmingly specific, but it's the most common way to do this!) Once a notification is fielded, the user can define Tasks that then perform actions on instance creation ("up" functions) and termination ("down" functions), as well as their associated failure events.
- When multiple tasks are running in a single
asgerinstance, they will be run in order on instance creation and in reverse order on instance termination.
asger is designed primarily to be run as a daemon, accepting "tasks" in the form of Ruby files. Tasks are fairly simple; more documentation will be forthcoming.
gem install asger asger --queue-url 'https://sqs.us-east-1.amazonaws.com/ACCOUNT_ID/QUEUE_NAME' --shared-credentials=CREDS --parameter-file /tmp/some_params.yaml --task-file %/echo.rb --task-file %/chef_deregister.rb
% is a special path character when passed to
--task-file; it refers to the
stock_scripts directory within the gem, so you can get started right away with the stock scripts.)
Add this line to your application's Gemfile:
And then execute:
Or install it yourself as:
gem install asger
Yardocs are available with
yard, though they aren't complete. Nothing in
asger is particularly complicated, though, so I recommend just taking a look at the source.
- Fork it ( https://github.com/[my-github-username]/asger/fork )
- Create your feature branch (
git checkout -b my-new-feature)
- Commit your changes (
git commit -am 'Add some feature')
- Push to the branch (
git push origin my-new-feature)
- Create a new Pull Request