# Grafana Dashboards with AWS CloudWatch Metrics

Grafana is a multi-platform open-source analytics and interactive visualization web application. It can be used to create graphs, charts, and alerts and allows connections to multiple data sources. In this post, I’ll discuss how to connect to AWS CloudWatch and create Grafana dashboards for AWS services. 

### IAM User Creation

To use CloudWatch as a Grafana datasource, a dedicated IAM user should be created for Grafana with attached policies attached.

• Create a Grafana user with the CloudWatchReadOnlyAccess policy attached to it. Upon successful creation of the user, create an access key and save the CSV file containing the credentials. 

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1717340244133/c51fbc23-b3c2-41d5-a2f4-0588505060ac.png align="center")

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1717340282891/4c632eab-2f26-46bd-b7eb-6a1bfa259d79.png align="center")

### Data Source Configuration

On the Grafana UI, select the configuration tab and click data sources. Search for CloudWatch and select it to configure with the necessary details. 

* Choose **Access & Secret key** under Authentication Provider and fill it out using the access and secret key downloaded from the previous step. 
    
* Set the default region, e.g., us-east-1, eu-west-1. 
    
* Click on the **Save & Test** button, and you should get a confirmation of a valid connection. 
    

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1717340478458/839c5ff5-5889-47f8-8438-9e304b5946b1.png align="center")

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1717340718182/3ef25941-a32f-4c24-b356-5f23aac6cb8e.png align="center")

### Create Custom Dashboards

Once the CloudWatch data source has been successfully setup, you can begin to create dashboards for AWS services of your choice.

* Select the **+** icon and click **Dashboard** 
    
* Click **Add an empty panel**
    
* Choose **CloudWatch** as the data source for the panel
    
* Configure the region, namespace, metric name, statistic, and dimension as shown below
    
* Save and apply
    
* Repeat the steps for whatever metric you want to visualise and create dashboards for different AWS services
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1717341048316/d17d99ea-ea3b-4f00-912f-f37cb1cd806f.png align="center")
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1717341037891/aaeed7fe-ca05-4926-a578-816cb4fd3472.png align="center")
    
    ![](https://cdn.hashnode.com/res/hashnode/image/upload/v1717341241501/3a0e40b1-6b2d-4007-a03c-a8e85da9a003.png align="left")
    

### Final Dashboard Examples

**EC2 Instance Dashboard**

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1717341465389/4401238c-7b3b-4e73-8f00-d9cb04ce0cde.png align="center")

**Lambda Functions Dashboard**

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1717341708891/790a71a2-536f-406b-8ee8-03a825204ca9.png align="center")
