Forge Home

aws_scheduler

aws scheduler - stop and start server instances according to schedule and save on aws costs.

11,778 downloads

6,536 latest version

4.4 quality score

We run a couple of automated
scans to help you access a
module's quality. Each module is
given a score based on how well
the author has formatted their
code and documentation and
modules are also checked for
malware using VirusTotal.

Please note, the information below
is for guidance only and neither of
these methods should be considered
an endorsement by Puppet.

Version information

  • 0.0.7 (latest)
  • 0.0.6
  • 0.0.5
  • 0.0.4
  • 0.0.3
  • 0.0.2
  • 0.0.1 (deleted)
released Sep 8th 2016
This version is compatible with:
  • , , , , ,

Start using this module

  • r10k or Code Manager
  • Bolt
  • Manual installation
  • Direct download

Add this module to your Puppetfile:

mod 'neillturner-aws_scheduler', '0.0.7'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add neillturner-aws_scheduler
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install neillturner-aws_scheduler --version 0.0.7

Direct download is not typically how you would use a Puppet module to manage your infrastructure, but you may want to download the module in order to inspect the code.

Download

Documentation

neillturner/aws_scheduler — version 0.0.7 Sep 8th 2016

aws_scheduler

Puppet Forge

Description

 aws scheduler - stop and start server instances according to schedule to save aws costs.
 
 This Puppet module will install aws-scheduler.
 See http://www.4synergy.nl/auto-start-stop-ec2-instances/.
 Tested on Centos 6. 
 
 It is a python script that runs regularly in cron that looks at all your instances for a
 tag "schedule" that contains a json string giving the stop and start schedule hour for mon to fri.
 it will them make sure the instance is stopped or started as per the scedule.

Installation

puppet module install --modulepath /path/to/puppet/modules neillturner-aws_scheduler

or add to Puppetfile: mod "neillturner/aws_scheduler"

Usage

 `class { 'aws_scheduler':
    aws_access_key_id     => 'MYAWSACCESSKEYID',
    aws_secret_access_key => 'MYAWSSECRETACESSKEY',
    aws_region            => 'MYAWSREGION',
    tag                   => 'schedule',
    exclude               => '[]',
    default               => '{"mon": {"start": 5, "stop": 18},"tue": {"start": 5, "stop": 18},"wed": {"start": 5, "stop": 18},"thu": {"start": 5, "stop": 18}, "fri": {"start": 5, "stop": 18}}',  
    time                  => 'gmt',
    script_path           => '/usr/sbin',
    cron_minute           => '10',
    cron_hour             => '*',
    log                   => '/var/log/aws-scheduler_cron.log',
    proxy                 => undef,
    proxy_port            => undef,
 }`

Parameters

 aws_access_key_id     Aws Access Key for your account
 aws_secret_access_key Aws Access Secret Key for your account
 aws_region            Aws Region
 tag                   tag using to hold json schedule defaults to 'schedule'
 exclude               Instance to exclude from scheduling default is '[]'
 default               json schedule array to default to (only used with the --force option)
                       '{"mon": {"start": 5, "stop": 18},"tue": {"start": 5, "stop": 18},"wed": {"start": 5, "stop": 18},"thu": {"start": 5, "stop": 18}, "fri": {"start": 5, "stop": 18}}'  
 script_path           path to store aws-scheduler.py script defaults to '/usr/sbin',
 time                  time used for checking against schedule defaults to 'gmt' can also be 'local'
 cron_minute           cron minute to run the script defaults to '10' i.e. 10 past the hour,
 cron_hour             cron hour to run the script defaults to '*'    i.e. every hour,
 log                   log for cron defaults to '/var/log/aws-scheduler_cron.log' (aws-scheduler ptyhob script logs to /var/log/aws-scheduler.log) 
 proxy                 proxy host to use when accessing aws           i.e. myproxy.com
 proxy_port            port of proxy                                  i.e. 3128

the aws_access_key_id and aws_secret_access_key are optional and allow the use of iam instance profiles.