aws_scheduler
aws scheduler - stop and start server instances according to schedule and save on aws costs.
Version information
released Sep 8th 2016
This version is compatible with:
- , , , , ,
Start using this module
Add this module to your Puppetfile:
mod 'neillturner-aws_scheduler', '0.0.7'
Learn more about managing modules with a PuppetfileDocumentation
neillturner/aws_scheduler — version 0.0.7 Sep 8th 2016
aws_scheduler
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.
Dependencies
- stahnma/epel ()
Copyright (c) 2014-2015 Neill Turner Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.