/
dashboard_for_each.tf
49 lines (46 loc) · 1.18 KB
/
dashboard_for_each.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
variable "query_list" {
default = [
{
title = "ALB Response Time 01"
query = "avg:aws.applicationelb.target_response_time.average{*}",
type = "solid"
},
{
title = "ALB Response Time 02"
query = "week_before(avg:aws.applicationelb.target_response_time.average{*})"
type = "dotted"
},
{
title = "ALB Response Time 03"
query = "avg:aws.applicationelb.target_response_time.average{*}",
type = "solid"
},
{
title = "ALB Response Time 04"
query = "week_before(avg:aws.applicationelb.target_response_time.average{*})"
type = "dotted"
},
]
}
resource "datadog_timeboard" "sample_12_for_each" {
title = "Terraform v0.12 for_each"
description = "created using the Datadog provider in Terraform"
read_only = true
dynamic "graph" {
for_each = var.query_list
content {
title = var.query_list[graph.key].title
viz = "timeseries"
precision = 0
request {
q = var.query_list[graph.key].query
type = "line"
style = {
palette = "orange"
type = var.query_list[graph.key].type
width = "normal"
}
}
}
}
}