-
Notifications
You must be signed in to change notification settings - Fork 25
/
dashboard.tf
103 lines (101 loc) · 2.16 KB
/
dashboard.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
/**
* This module creates a CloudWatch dashboard for you app,
* showing its CPU and memory utilization and auto-scaling metrics.
*/
resource "aws_cloudwatch_dashboard" "cloudwatch_dashboard" {
dashboard_name = "${var.app}-${var.environment}-fargate"
dashboard_body = <<EOF
{
"widgets": [
{
"type": "metric",
"x": 0,
"y": 0,
"width": 12,
"height": 6,
"properties": {
"view": "timeSeries",
"stacked": false,
"metrics": [
[
"AWS/ECS",
"MemoryUtilization",
"ServiceName",
"${var.app}-${var.environment}",
"ClusterName",
"${var.app}-${var.environment}",
{
"color": "#1f77b4"
}
],
[
".",
"CPUUtilization",
".",
".",
".",
".",
{
"color": "#9467bd"
}
]
],
"region": "${var.region}",
"period": 300,
"title": "Memory and CPU utilization",
"yAxis": {
"left": {
"min": 0,
"max": 100
}
}
}
},
{
"type": "metric",
"x": 12,
"y": 0,
"width": 12,
"height": 6,
"properties": {
"metrics": [
[
"AWS/NetworkELB",
"UnHealthyHostCount",
"TargetGroup",
"${aws_lb_target_group.main.arn_suffix}",
"LoadBalancer",
"${aws_lb.main.arn_suffix}",
{
"id": "m2",
"color": "#d62728",
"stat": "Maximum",
"period": 1
}
],
[
".",
"HealthyHostCount",
".",
".",
".",
".",
{
"period": 1,
"stat": "Maximum",
"id": "m3",
"color": "#98df8a"
}
]
],
"view": "timeSeries",
"region": "${var.region}",
"period": 300,
"stacked": true,
"title": "Container Count"
}
}
]
}
EOF
}