1. Create two EC2 by using User-Data-Amazon-Linux Script
- Launch Two EC2 with Two Availability Zone
I will left information about vpc,subnet[public],security. Please configure with yours.
Attach IAM Instance role by using
CloudWatchAgentServerPolicy
- Add User Data and Click
Launch Instance - Wait until
2/2 checks passed
2. Create LoadBalancer
- Click
Load Balancer
- Click
Create load balancers
- Click
Createof Application Load Balance
- Write
Load balancer name
Choose your vpc, select public subnet which route to IGW, security group
Click
Create target group
- Write
Target group nameand ClickNext
- Choose both EC2 and Click
Include as pending below
- Click
Create Target Group
- Choose
LabTG
- Click
Create load balancer
3. Open Running Public IPv4 DNS in browser
- Reload these links in browser a few times
- Add /admin.php at the end of public ipv4 dns and reload in browser a few times
4. Create a metric filter for 404 errors
- In the AWS Management Console, type
CloudWatchand click this.
- In the navigation pane, in Logs, select
Log groups
- Click
access_log
- In the Log streams tab, select the
i-02a1487b82ba62ad7
• In Filter events, enter 404, and then press Enter.
- Click
Create metric filter
Filter name -
LabServer1-Error404Metric namespace -
CloudwatchLabMetric name -
LabServer1-Error404Metric value -
1Default value -
0Unit -
CountClick
Create
- Configure like this for
i-0ab69fd72c3a5498ctoo but changes as2for Filter name and Metric name.
5. Create a custom CloudWatch dashboard
- Click
Dashboards
- Click
Create dashboard
- Write name and Click
Create dashboard
- Click
Next
- Select Untitled graph, and then enter
404-Error-log
- Click
CloudwatchLab
Click
Metrics with no dimensionsSelect both EC2 and Click
Create widget
- Click
+
- Click
Next
- Select Untitled graph, and then enter
Alb-Traffic-Log
- Click
ApplicationELB
- Click
Per AppELB Metrics
- Choose the metric you want to monitor and Click
Create widget
[!NOTE]
Choose your alb carefully if you have a lof of alb
Click
+Click
NextSelect Untitled graph, and then enter
Memory UsageType
mem_used_percentand enterClick
ImageId, InstanceId, InstanceTypeSelect both EC2 and Click
Create widget
Click
+Click
NextSelect Untitled graph, and then enter
CPU UsageType
CPUUtilizationand enterClick
Per-Instance MetricsSelect both EC2 and Click
Create widget
- Click
Save
Status: Complete ✅
Congratulations on successfully completing this.
Related Resources
- Lab Repository: AWS Learning Labs
- Technical Blog: Whispering Cloud Insights
- DEV Community: Thu Kha Kyawe






































Top comments (0)