Forge Home

cloudwatchlogs

Configure AWS Cloudwatch Logs on Amazon Linux instances.

527,844 downloads

189,043 latest version

3.1 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

  • 2.3.1 (latest)
  • 2.3.0
  • 2.2.1 (deleted)
  • 2.2.0
  • 2.1.0
  • 2.0.0
  • 1.1.2
  • 1.1.1
  • 1.1.0
  • 1.0.0
  • 0.1.0
released May 25th 2015
This version is compatible with:
  • Puppet Enterprise 3.x
  • Puppet 3.x
  • Amazon, Ubuntu, RedHat, CentOS
This module has been deprecated by its author since Jul 22nd 2021.

Start using this module

Documentation

kemra102/cloudwatchlogs — version 1.1.1 May 25th 2015

cloudwatchlogs

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.

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

In addition to the minimum config above you can also declare which logs will be shipped to Cloudwatch Logs:

class { 'cloudwatchlogs':
  logs                  => [
    { 'Messages' => '/var/log/messages' },
    { 'Secure'   => '/var/log/secure' },
    { 'Mail'     => '/var/log/maillog' },
  ],
  region                => 'eu-west-1',
  aws_access_key_id     => 'AKIAIOSFODNN7EXAMPLE',
  aws_secret_access_key => 'wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY',
}

Reference

state_file:

Defaults:

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

State file for the awslogs agent.

streamname:

Default: {instance-id}

The name of the stream in Cloudwatch Logs.

logs:

Default: [ { 'Messages' => '/var/log/messages', }, { 'Secure' => '/var/log/secure', }, ]

An array of hashes containing the 'name' & the 'path' of the log file(s) to be sent to Cloudwatch Logs.

region:

Default: undef

The region your EC2 instance is running in.

aws_access_key_id:

Default: undef

The Access Key ID from the IAM user that has access to Cloudwatch Logs.

aws_secret_access_key:

Default: undef

The Secret Access Key from the IAM user that has access to Cloudwatch Logs.

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