-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.tf
72 lines (54 loc) · 1.42 KB
/
main.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
provider "datadog" {}
variable "subdomains" {
description = "Subdomains to check"
type = set(string)
default = [
"", "www"
]
}
data "datadog_synthetics_locations" "locations" {}
resource "datadog_synthetics_test" "router" {
type = "api"
subtype = "icmp"
name = "router.whipple.groat.us"
message = "@[email protected]"
tags = ["tld:groat.us"]
status = "live"
request_definition {
should_track_hops = true
host = "router.whipple.groat.us"
number_of_packets = 4
}
assertion {
type = "packetLossPercentage"
operator = "is"
target = "0"
}
locations = [for i in keys(data.datadog_synthetics_locations.locations.locations) : i if length(regexall("^aws:us-west-*", i)) > 0]
options_list {
tick_every = 60
}
}
resource "datadog_synthetics_test" "test_browser" {
for_each = var.subdomains
type = "api"
subtype = "http"
name = "${each.value}%{if each.value != ""}.%{endif}stephengroat.com"
message = "@[email protected]"
tags = ["tld:stephengroat.com"]
status = "live"
request_definition {
method = "GET"
url = "http://${each.value}%{if each.value != ""}.%{endif}stephengroat.com"
}
assertion {
type = "statusCode"
operator = "is"
target = "200"
}
locations = ["aws:eu-central-1", "aws:us-east-2"]
options_list {
tick_every = 43200
follow_redirects = true
}
}