Skip to content

deekayen/ansible-role-aws-cloudwatch-agent

 
 

Repository files navigation

AWS CloudWatch Agent

CI Project Status: Inactive – The project has reached a stable, usable state but is no longer being actively developed; support/maintenance will be provided as time allows.

Ansible role to install and configure AWS Cloudwatch Agent on both Windows and Linux.

Requirements

ansible.windows collection

Role Variables

Available variables are listed below, along with default values (see defaults/main.yml):

aws_cw_region: us-east-1

Windows EventLog Monitoring

aws_cw_windows_events:
	- name: 'System'
	  levels: ['ERROR', 'CRITICAL']
	  format: 'text'
	  log_group: 'Windows/System'
	- name: 'Application'
	  levels: ['ERROR']
	  format: 'text'
	  log_group: 'Windows/Application'

Log files Monitoring

aws_cw_logfiles
 - path: /var/log/auth.log
   timestamp_format: "%b %d %H:%M:%S"
   log_group: "auth"

Allows to use custom cloudwatch template e.g. the following can be put same level as the playbook

aws_cw_config_template_path: 'templates/CloudwatchConfig.json'

Enable Debug Log

aws_cw_log_debug: true

Configuration for On-Prem - Requires to create default AWS profile with access and secret key

aws_cw_agent_type: onPremise
aws_profie: AmazonCloudWatchAgent
aws_profile_path: '/tmp/credentials'

Dependencies

None.

Example Playbook

- hosts: all
  roles:
     - role: deekayen.aws_cloudwatch_agent
       vars:
          aws_cw_region: us-east-2

License

MIT / BSD

Author Information

This role was created in 2019 by Ripon Banik