0
0
AWScloud~30 mins

CloudWatch dashboards in AWS - Mini Project: Build & Apply

Choose your learning style9 modes available
Create a Simple AWS CloudWatch Dashboard
📖 Scenario: You are a cloud engineer setting up monitoring for a web application hosted on AWS. You want to create a CloudWatch dashboard to visualize key metrics like CPU utilization and network traffic.
🎯 Goal: Build a CloudWatch dashboard JSON configuration that shows two widgets: one for CPU utilization and one for network in/out for an EC2 instance.
📋 What You'll Learn
Create a dashboard body JSON structure with widgets array
Add a widget for CPUUtilization metric from EC2 namespace
Add a widget for NetworkIn and NetworkOut metrics from EC2 namespace
Use correct metric dimensions with InstanceId
Use valid JSON structure deployable to AWS CloudWatch
💡 Why This Matters
🌍 Real World
CloudWatch dashboards help visualize and monitor AWS resource metrics in one place, making it easier to spot issues and optimize performance.
💼 Career
Cloud engineers and DevOps professionals often create and maintain dashboards to ensure system health and respond quickly to alerts.
Progress0 / 4 steps
1
Create the initial dashboard JSON structure
Create a variable called dashboard_body and assign it a JSON string with an empty widgets array: {"widgets": []}.
AWS
Need a hint?

Use single quotes outside and double quotes inside for the JSON string.

2
Add a CPU Utilization widget configuration
Add a variable called cpu_widget and assign it a JSON object string representing a CloudWatch metric widget for CPUUtilization metric in the AWS/EC2 namespace with dimension InstanceId set to i-1234567890abcdef0. The widget should have a width of 6 and height of 6.
AWS
Need a hint?

Follow AWS CloudWatch metric widget JSON format with properties including metrics array.

3
Add a Network In/Out widget configuration
Add a variable called network_widget and assign it a JSON object string representing a CloudWatch metric widget for NetworkIn and NetworkOut metrics in the AWS/EC2 namespace with dimension InstanceId set to i-1234567890abcdef0. The widget should have a width of 6 and height of 6.
AWS
Need a hint?

Include both NetworkIn and NetworkOut metrics in the metrics array.

4
Combine widgets into the dashboard body
Update the dashboard_body variable to include the cpu_widget and network_widget JSON objects inside the widgets array. Use Python's json module to parse and combine the JSON strings properly.
AWS
Need a hint?

Use json.loads() to convert strings to objects, append widgets, then json.dumps() to convert back to string.