The Ultimate DevOps Explanation

Dream Has Come True!

I am a person who believes that if someone wants to do a successful job, they first need to understand what the job is fundamentally. I love how Albert Einstein put it as he states:

If you can’t explain it simply, you don’t understand it well enough.
– Albert Einstein

With that being said, I consider Amazon’s DevOps definition as a simple yet amazing definition. It describes DevOps in a rough way but also covers nearly everything. Although, it needs some elaboration.

From what I’ve seen, ~99% of the definitions on the internet don’t cover up everything related to DevOps. Let’s be ~1%.

If you know what DevOps actually is, you will start seeing things from a different, constructive, rewarding and top-view perspective and contribute even more to your team.

Continue reading

Creating Cloudwatch Dashboards per Environment with Python

Show Me The Code Already

After installing Cloudwatch Agent to the machines you want to monitor, it’s time to create dashboards to view real-time metrics.

There are some ways to create Cloudwatch Dashboards such as creating them manually by selecting widgets from AWS Console, with Cloudformation etc.

I’ve decided to create them with Python because in DevOps literature, there is no such a thing as manually creating something. I also didn’t want to use Cloudformation because I like scripting and we have many applications to monitor in our company, thus, I needed something to iterate over our environments and create dashboards for each of them.
Continue reading

Cloudwatch Metric Configuration JSON

Deploying Configuration .json to Instance

To deploy this configuration file and make the Cloudwatch Agent read it which we installed via Ansible by this post, you need to be sure that you installed Cloudwatch Agent to your instance properly. After installing the agent, you need to put this configuration file under /opt/aws/amazon-cloudwatch-agent/etc directory and make sure you name it amazon-cloudwatch-agent.json.

When you start the agent after putting your configuration file, Cloudwatch service will automatically turn it into a .toml file under the same directory and reads that file.

If your agent refuse to start when you run this:

start amazon-cloudwatch-agent

Make sure you don’t have any syntax errors in metric configuration or common-config.toml where you put your proxies.

Continue reading

Cloudwatch Agent Installation to EC2 Instances with Ansible


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


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.

You can run this playbook on your Controller machine with:

ansible-playbook -s configure-cloudwatch-agent.yml

In fact, you can use variables to configure different environments such as Development, Production etc. For example, we could define “/opt/aws” as our base_dir and call it
{{ base_dir }}.
Continue reading