Cloudwatch Agent Installation to EC2 Instances with Ansible

Reading Time: 3 minutes

amazon-cloudwatch

Prerequisites

In this post, I will be explaining how to install Cloudwatch Agent using an Ansible Controller Host machine which is used for initializing and provisioning other machines.

You will need:

  • Basic knowledge of Ansible
  • A Controller machine to run the playbook remotely
  • A Controller machine with Ansible installed
  • A Remote machine with SSH Daemon and Python interpreter installed
  • A Remote machine with proper Policy attached (Allowance for PutMetricData)
  • Make sure you have a proper configuration .json file, check here

Playbook

Using a Controller EC2 instance makes it easier to manage other instances since in this way, you don’t need to install Ansible each machine you manage because it works with SSH Daemon and an up-to-date Python interpreter.

Continue reading