All Projects → kemra102 → Puppet Cloudwatchlogs

kemra102 / Puppet Cloudwatchlogs

Licence: bsd-2-clause
Puppet module for configuring AWS Cloudwatch Logs on Amazon Linux, Ubuntu, Red Hat & CentOS EC2 instances.

Labels

Projects that are alternatives of or similar to Puppet Cloudwatchlogs

Puppet Manila
OpenStack Manila Puppet Module. Mirror of code maintained at opendev.org.
Stars: ✭ 26 (+136.36%)
Mutual labels:  puppet
Windows sql
Puppet Module wich allow you to install and configure SQL Server on windows server 2012 or newer
Stars: ✭ 8 (-27.27%)
Mutual labels:  puppet
Vagrant Ldap Vm
quick and dirty ldap vm
Stars: ✭ 9 (-18.18%)
Mutual labels:  puppet
Puppet Node manager
Create and manage PE node groups as resources.
Stars: ✭ 7 (-36.36%)
Mutual labels:  puppet
Aglara
A Gentoo Linux Advanced Reference Architecture
Stars: ✭ 7 (-36.36%)
Mutual labels:  puppet
Stingray Puppet
Puppet module to control Riverbed Stingray Traffic Manager
Stars: ✭ 8 (-27.27%)
Mutual labels:  puppet
Drupal Puppet
Puppet modules for managing Drupal and the LAMP stack
Stars: ✭ 24 (+118.18%)
Mutual labels:  puppet
Selenium Puppet
a puppet module for installing the selenium server and selenium-webdriver gem
Stars: ✭ 10 (-9.09%)
Mutual labels:  puppet
Puppet Redis cluster
Install multiple redis instances via Puppet to configure a cluster with redis-trib.rb (for Redis version >= 3.0)
Stars: ✭ 8 (-27.27%)
Mutual labels:  puppet
Puppet Postgres Hardening
Postgres Web Server Hardening with Puppet
Stars: ✭ 9 (-18.18%)
Mutual labels:  puppet
Logging Hooks Presentation
material for presentation about logging hooks in PostgreSQL
Stars: ✭ 7 (-36.36%)
Mutual labels:  puppet
Puppet Nfs
Stars: ✭ 7 (-36.36%)
Mutual labels:  puppet
Puppet Etcd
etcd is a distributed key value store that provides a reliable way to store data across a cluster of machines.
Stars: ✭ 9 (-18.18%)
Mutual labels:  puppet
Symfony2 Puppet
A simple layout of your Vagrant / puppet manifests that you can drop into your root directory of your symfony2 project
Stars: ✭ 26 (+136.36%)
Mutual labels:  puppet
Ll
LL - Object-Oriented Scheme Implementation
Stars: ✭ 9 (-18.18%)
Mutual labels:  puppet
Vagrant Puppet Nginx Uwsgi Flask
A pretty bare set up for running Flask in nginx through uwsgi in Vagrant deployed by Puppet. Got it?
Stars: ✭ 25 (+127.27%)
Mutual labels:  puppet
Aws Tilemill
Stars: ✭ 8 (-27.27%)
Mutual labels:  puppet
Puppet Rails
A Puppet module for managing rails
Stars: ✭ 10 (-9.09%)
Mutual labels:  puppet
Nodejs Vagrantbox
Simple nodejs box vagrant configuration (trusty64, nodejs, git, bower...)
Stars: ✭ 10 (-9.09%)
Mutual labels:  puppet
Aco Tomcat
Puppet module for Tomcat
Stars: ✭ 9 (-18.18%)
Mutual labels:  puppet

cloudwatchlogs Build Status

Table of Contents

  1. Overview
  2. Module Description - What the module does and why it is useful
  3. Setup - The basics of getting started with cloudwatchlogs
  4. Usage - Configuration options and additional functionality
  5. Reference - An under-the-hood peek at what the module is doing and how
  6. Limitations - OS compatibility, etc.
  7. Development - Guide for contributing to the module

Overview

This module installs, configures and manages the service for the AWS Cloudwatch Logs Agent on Amazon Linux, Ubuntu, Red Hat & CentOS EC2 instances.

Module Description

CloudWatch Logs can be used to monitor your logs for specific phrases, values, or patterns. For example, you could set an alarm on the number of errors that occur in your system logs or view graphs of web request latencies from your application logs. You can view the original log data to see the source of the problem if needed. Log data can be stored and accessed for as long as you need using highly durable, low-cost storage so you don’t have to worry about filling up hard drives.

Setup

What cloudwatchlogs affects

  • The awslogs package.
  • Configuration files under /etc/awslogs.
  • The awslogs service.

Setup Requirements

This module does NOT manage the AWS CLI credentials. As such if you are not using an IAM role (recommended) then you will need some other way of managing the credentials.

This module by Justin Downing is recommended for this purpose.

Beginning with cloudwatchlogs

The minimum you need to get this module up and running is (assuming your instance is launched with a suitable IAM role):

include '::cloudwatchlogs'

Usage

The above minimal config can also be presented as:

class { '::cloudwatchlogs': }

On none Amazon Linux instances you also need to provide a default region:

class { '::cloudwatchlogs': region => 'eu-west-1' }

For each log you want sent to Cloudwatch Logs you create a cloudwatchlogs::log resource.

A simple example that might be used on the RedHat ::osfamily is:

class { '::cloudwatchlogs': region => 'eu-west-1' }

cloudwatchlogs::log { 'Messages':
  path => '/var/log/messages',
}
cloudwatchlogs::log { 'Secure':
  path => '/var/log/secure',
}

Another example that might be used on the RedHat ::osfamily to create individual log config files in /etc/awslogs/config/ is:

class { '::cloudwatchlogs': region => 'eu-west-1' }

cloudwatchlogs::compartment_log { 'Access':
  path => '/var/log/httpd/access_logs',
}
cloudwatchlogs::compartment_log { 'Error':
  path => '/var/log/httpd/error_logs',
}

Alternatively logs can be defined as part of the main cloudwatchlogs class:

class { '::cloudwatchlogs':
  region => 'eu-west-1',
  logs   => {
    'Messages' => {
      path => '/var/log/messages'
    },
    'Secure'   => {
      path => '/var/log/secure'
    }
  }
}

See the examples/ directory for further examples.

Reference

cloudwatchlogs

state_file:

Defaults:

  • Amazon Linux: /var/lib/awslogs/agent-state
  • Other: /var/awslogs/state/agent-state

State file for the awslogs agent.

logging_config_file:

Defaults: /etc/awslogs/awslogs_dot_log.conf

Config file for the awslogs agent logging system (http://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/AgentReference.html).

region:

Default: undef

log_level:

Default: undef

The region your EC2 instance is running in.

NOTE: This is required for none Amazon distros.

cloudwatchlogs::log

path

Default: undef

Optional. This is the absolute path to the log file being managed. If not set the name of the resource is used instead (and must be an absolute path if that this situation occurs).

streamname

Default: {instance_id}

The name of the stream in Cloudwatch Logs.

datetime_format

Default: %b %d %H:%M:%S

Specifies how the timestamp is extracted from logs. See the official docs for further info.

log_group_name

Default: Resource Name

Specifies the destination log group. A log group will be created automatically if it doesn't already exist.

multi_line_start_pattern

Default: undef

Optional. This is a regex string that identifies the start of a log line. See the official docs for further info.

Http Proxy Usage

If you have a http_proxy or https_proxy then run the following puppet code after calling cloudwatchlogs to modify the launcher script as a workaround bcause awslogs python code currently doesn't have http_proxy support:

$launcher = "#!/bin/sh
# Version: 1.3.5
echo -n $$ > /var/awslogs/state/awslogs.pid
/usr/bin/env -i AWS_CONFIG_FILE=/var/awslogs/etc/awscli.conf HOME=\$HOME HTTPS_PROXY=${http_proxy} HTTP_PROXY=${http_proxy} NO_PROXY=169.254.169.254  /bin/nice -n 4 /var/awslogs/bin/aws logs push --config-file /var/awslogs/etc/awslogs.conf >> /var/log/awslogs.log 2>&1
"

file { '/var/awslogs/bin/awslogs-agent-launcher.sh':
  ensure  => file,
  owner   => root,
  group   => root,
  mode    => '0755',
  content => $launcher,
  require => Class['cloudwatchlogs'],
}

Limitations

This module is currently only compatible with:

  • Amazon Linux AMI 2014.09 or later.
  • Ubuntu
  • Red Hat
  • CentOS

More information on support as well as information in general about the set-up of the Cloudwatch Logs agent can be found here.

Development

Contributions are welcome via pull requests.

Contributors

Authors:

All other contributions: https://github.com/kemra102/puppet-cloudwatchlogs/graphs/contributors

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].