-
-
Notifications
You must be signed in to change notification settings - Fork 9
/
synthetics_updatecenter.tf
62 lines (56 loc) · 1.41 KB
/
synthetics_updatecenter.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
locals {
update_center_scheme = ["https", "http"]
update_center_hosts = ["updates.jenkins.io", "updates.jenkins-ci.org"]
update_center_uris = [
"/",
"/index.html",
"/update-center.json",
"/current",
"/current/",
"/current/update-center.json",
"/latest/zos-connector.hpi",
"/download/plugins/zos-connector/3.257.v41e144167971/zos-connector.hpi",
"/update-center.json?id=default&version=2.462.2",
"/updates",
"/updates/",
"/updates/hudson.tasks.Maven.MavenInstaller.json",
"/current/updates",
"/current/updates/",
"/latest",
"/latest/",
]
update_center_urls = [
for triplet in setproduct(local.update_center_scheme, local.update_center_hosts, local.update_center_uris) : {
scheme = triplet[0]
hostname = triplet[1]
uri = triplet[2]
}
]
}
resource "datadog_synthetics_test" "updates_center" {
for_each = tomap({
for url in local.update_center_urls : format("%s://%s%s", url.scheme, url.hostname, url.uri) => url.hostname
})
type = "api"
request_definition {
method = "GET"
url = each.key
}
assertion {
type = "statusCode"
operator = "is"
target = "200"
}
locations = ["aws:eu-central-1"]
options_list {
tick_every = 900
follow_redirects = true
}
name = each.key
message = "Notify @pagerduty"
tags = [
each.value,
"production"
]
status = "live"
}