Code Monkey home page Code Monkey logo

puppet-aws_helper's Introduction

puppet-aws_helper

Aws Helper for an instance

Allows functions on EBS volumes, snapshots, IP addresses and more

  • initially snapshots are supported
  • cleanup ebs volumes.

Minimal Usage

Assuming server started with an IAM role that have read access to AWS can create and delete snapshots. To backup the root disk on device /dev/sda daily at 2am and keep the last 7 days of snapshots and send an email at 3am giving a list of the last 20 snapshots.

 class { 'aws_helper': }

 class { 'aws_helper::ebs_backup'
   cron_hour        => '2',
 }
 
 class { 'aws_helper::snap_email'
   cron_hour        => '3',
   to               => '[email protected]',
   from             => '[email protected]',
   email_server     => 'smtpemailserver.com',
 }

Cleanup ebs disks - Delete old server root disks. Disks that are 8GB in size, not attached to a server, not tagged in any way and from a snapshot will be deleted.

 class { 'aws_helper::ebs_cleanup'
   cron_hour        => '19',
 }

Complex Usage

Snapshot EBS root disk and attached disk to device /dev/sdf volume vol-654321 access AWS through an http proxy and send an email at 3am giving a list of the last 30 snapshots. If your server does not have a role then you need to code the AWS keys although this is not best practice.

 class { 'aws_helper': }

 class { 'aws_helper::ebs_backup'
   aws_access_key    => 'xxxxxxxxxxxx',
   aws_secret_key    => 'yyyyyyyyyyy',
   http_proxy        => 'http://10.20.30.40:3123',
   helper_path       => '/usr/bin/',
   root_device       => '/dev/sda',
   root_vol          => 'vol-123456',
   attached_device   => '/dev/sdf',
   attached_vol      => 'vol-654321',
   log               => '/var/log/ebs_backup.log',
   snapshots_to_keep => '20',
   description       => 'testserver',
   script_path       => '/usr/sbin',
   cron_minute       => '30',
   cron_hour         => '2',
 )
 
 class { 'aws_helper::snap_email'
   aws_access_key    => 'xxxxxxxxxxxx',
   aws_secret_key    => 'yyyyyyyyyyy',
   owner             => 999888777777,
   http_proxy        => 'http://10.20.30.40:3123',     
   cron_hour        => '3',
   to               => '[email protected]',
   from             => '[email protected]',
   email_server     => 'smtpemailserver.com',
   subject          => 'My EBS Backups',
   rows             => '30',
 }     

Other functions to follow

puppet-aws_helper's People

Contributors

neillturner avatar

Watchers

 avatar  avatar

puppet-aws_helper's Issues

UnknownParameter: The parameter AwsOwner is not recognized (RightAws::AwsError)

Hi Neil,

We are getting following error on snap email function -:

/usr/local/share/gems/gems/right_aws-3.1.0/lib/awsbase/right_awsbase.rb:568:in request_info_impl': UnknownParameter: The parameter AwsOwner is not recognized (RightAws::AwsError) from /usr/local/share/gems/gems/right_aws-3.1.0/lib/ec2/right_ec2.rb:157:inrequest_info'
from /usr/local/share/gems/gems/right_aws-3.1.0/lib/awsbase/right_awsbase.rb:582:in request_cache_or_info' from /usr/local/share/gems/gems/right_aws-3.1.0/lib/ec2/right_ec2.rb:181:indescribe_resources_with_list_and_options'
from /usr/local/share/gems/gems/right_aws-3.1.0/lib/ec2/right_ec2_ebs.rb:216:in describe_snapshots' from /usr/local/share/gems/gems/aws_helper-0.0.8/lib/awshelper/cli.rb:159:insnap_email'
from /usr/local/share/gems/gems/thor-0.19.1/lib/thor/command.rb:27:in run' from /usr/local/share/gems/gems/thor-0.19.1/lib/thor/invocation.rb:126:ininvoke_command'
from /usr/local/share/gems/gems/thor-0.19.1/lib/thor.rb:359:in dispatch' from /usr/local/share/gems/gems/thor-0.19.1/lib/thor/base.rb:440:instart'
from /usr/local/share/gems/gems/aws_helper-0.0.8/bin/aws_helper:5:in <top (required)>' from /usr/local/bin/aws_helper:23:inload'
from /usr/local/bin/aws_helper:23:in `

'

Environment Deails : Centos 7.2
Ruby 2.0.0
aws_helper 0.0.8
right_aws (3.1.0)
right_http_connection (1.5.0)
thor (0.19.1)

Could you be able to help us in this error.

Thanks & Regards
Dharmender

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.