Whenever Elasticbeanstalk

Allows you to run cron jobs easily on one or all AWS Elastic Beanstalk instances.
Alternatives To Whenever Elasticbeanstalk
Project NameStarsDownloadsRepos Using ThisPackages Using ThisMost Recent CommitTotal ReleasesLatest ReleaseOpen IssuesLicenseLanguage
Boto6,46922,943447a year ago121July 11, 20181,156otherPython
For the latest version of boto, see https://github.com/boto/boto3 -- Python interface to Amazon Web Services
Terraform Aws Vpc2,727
9 days ago16apache-2.0HCL
Terraform module which creates VPC resources on AWS 🇺🇦
Aws Saa C02 Study Guide1,340
25 days ago10
How to become a certified AWS Solutions Architect
Eks Distro1,280
5 days ago21apache-2.0Shell
Amazon EKS Distro (EKS-D) is a Kubernetes distribution based on and used by Amazon Elastic Kubernetes Service (EKS) to create reliable and secure Kubernetes clusters.
2 months ago6apache-2.0Shell
A collection of bash shell scripts for automating various tasks with Amazon Web Services using the AWS CLI and jq.
Awscala742114 months ago9February 13, 202171otherScala
Using AWS SDK on the Scala REPL
Laravel Aws Eb418
a year ago17Shell
Ready-to-deploy configuration to run Laravel on AWS Elastic Beanstalk.
Eb_deployer3992924 years ago74April 18, 201824mitRuby
AWS Elastic Beanstalk blue-green deployment automation from ThoughtWorks Mingle Team
Aws Service Catalog Reference Architectures396
4 months ago15apache-2.0JavaScript
Sample CloudFormation templates and architecture for AWS Service Catalog
Laravel Aws Worker3111943 months ago37November 27, 202214mitPHP
Run Laravel (or Lumen) tasks and queue listeners inside of AWS Elastic Beanstalk workers
Alternatives To Whenever Elasticbeanstalk
Select To Compare

Alternative Project Comparisons


AWS has recently made changes to their EB ENV variables that are catastrophic for much of the rails deployment approaches for EB. This includes whenever-elasticbeanstalk. We are investigating how we can address these issues. Please see Issue 18 for further details. Will update when a resolution is available.


Whenever-elasticbeanstalk is an extension gem to Whenever that automatically ensures that one instance in an AWS Elastic Beanstalk environment is set as leader. This allows you to run cron jobs on all instances, or just on the leader. This is required since Elastic Beanstalk may start or stop any instance as it scales up or down.


Add this line to your application's Gemfile:

gem 'whenever-elasticbeanstalk'

And then execute:

$ bundle

Or install it yourself as:

$ gem install whenever-elasticbeanstalk

Getting started

$ cd /apps/my-great-project
$ wheneverize-eb .

This will create an initial config/schedule.rb file for you with the ensure_leader job set to run every minute. It will also create a .ebextensions/cron.config file that will automatically choose a leader on environment initialization, and start up Whenever with the correct leader role. Lastly, it creates the config/whenever-elasticbeanstalk.yml file that will contain your AWS credentials for retrieving your environment information.

Manually updating schedule

If you are already using Whenever, running wheneverize-eb . won't overwrite your config/schedule.rb file. You'll need to add the following lines in order for your environment to always have one leader.

every 1.minute do
  command "cd /var/app/current && bundle exec ensure_one_cron_leader"

EC2 Instance IAM Role Permissions

In order for the scripts to work, you need to ensure that the EC2 Instance Role has access to EC2 instances and tags (further reading at AWS Documentation ). Ensure that your EC2 instance has at a minimum the following permissions:

Example policy:

  "Version": "2012-10-17",
  "Statement": [
      "Action": [
      "Resource": [
      "Effect": "Allow"

Make sure to add the RACK_ENV environment variable to your environment if you haven't already done so. This variable is not created automatically by AWS. You can add the following line to your .elasticbeanstalk/optionsettings.appname-env file:



For config/schedule.rb usage, please see the documentation for the Whenever gem.

Run a task on only one instance

To run a task only on one instance, assign the task to the leader role.

every :day, :at => "12:30am", :roles => [:leader] do
	runner "MyModel.task_to_run_nightly_only_on_one_instance"

Run a task on all instances

To run a task on all instance, omit the roles option.

every 1.minute do
	command "touch $EB_CONFIG_APP_SUPPORT/.cron_check"


  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request
Popular Elastic Projects
Popular Amazon Web Services Projects
Popular Companies Categories

Get A Weekly Email With Trending Projects For These Categories
No Spam. Unsubscribe easily at any time.