-
Notifications
You must be signed in to change notification settings - Fork 51
/
monitoring_webtests.tf
62 lines (56 loc) · 3.7 KB
/
monitoring_webtests.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
##################
### Application Insights Availability Tests
##################
# Ping the CatalogService API
# We are using the catalogitem/?limit=1 API, since that is one of the APIs that does not require authentication
resource "azurerm_application_insights_web_test" "api_ping" {
name = "${local.prefix}-appinsights-webtest-api-global"
location = azurerm_resource_group.monitoring.location
resource_group_name = azurerm_resource_group.monitoring.name
application_insights_id = azurerm_application_insights.monitoring.id
kind = "ping"
frequency = 300
timeout = 30
enabled = true
geo_locations = ["us-tx-sn1-azr", "us-il-ch1-azr", "emea-fr-pra-edge", "emea-se-sto-edge", "apac-hk-hkn-azr", "apac-jp-kaw-edge", "latam-br-gru-edge", "emea-au-syd-edge"]
# The GUIDs are ignored by Application Insights so we can set them all to zero
configuration = <<XML
<WebTest Name="${local.prefix}-appinsights-webtest-api-global" Id="00000000-0000-0000-0000-000000000000" Enabled="True" CssProjectStructure="" CssIteration="" Timeout="30" WorkItemIds="" xmlns="http://microsoft.com/schemas/VisualStudio/TeamTest/2010" Description="" CredentialUserName="" CredentialPassword="" PreAuthenticate="True" Proxy="default" StopOnError="False" RecordedResultFile="" ResultsLocale="">
<Items>
<Request Method="GET" Guid="00000000-0000-0000-0000-000000000000" Version="1.1" Url="https://${local.frontdoor_fqdn}/catalogservice/api/1.0/catalogitem/?limit=1" ThinkTime="0" Timeout="30" ParseDependentRequests="False" FollowRedirects="False" RecordResult="True" Cache="False" ResponseTimeGoal="0" Encoding="utf-8" ExpectedHttpStatusCode="200" ExpectedResponseUrl="" ReportingName="" IgnoreHttpStatusCode="False" />
</Items>
</WebTest>
XML
lifecycle {
ignore_changes = [
# Ignore changes to tags because there is a hidden-link tag that gets created by ARM
tags
]
}
}
# Ping the Website
resource "azurerm_application_insights_web_test" "website_ping" {
name = "${local.prefix}-appinsights-webtest-website-global"
location = azurerm_resource_group.monitoring.location
resource_group_name = azurerm_resource_group.monitoring.name
application_insights_id = azurerm_application_insights.monitoring.id
kind = "ping"
frequency = 300
timeout = 30
enabled = true
geo_locations = ["us-tx-sn1-azr", "us-il-ch1-azr", "emea-fr-pra-edge", "emea-se-sto-edge", "apac-hk-hkn-azr", "apac-jp-kaw-edge", "latam-br-gru-edge", "emea-au-syd-edge"]
# The GUIDs are ignored by Application Insights so we can set them all to zero
configuration = <<XML
<WebTest Name="${local.prefix}-appinsights-webtest-website-global" Id="00000000-0000-0000-0000-000000000000" Enabled="True" CssProjectStructure="" CssIteration="" Timeout="30" WorkItemIds="" xmlns="http://microsoft.com/schemas/VisualStudio/TeamTest/2010" Description="" CredentialUserName="" CredentialPassword="" PreAuthenticate="True" Proxy="default" StopOnError="False" RecordedResultFile="" ResultsLocale="">
<Items>
<Request Method="GET" Guid="00000000-0000-0000-0000-000000000000" Version="1.1" Url="https://${local.frontdoor_fqdn}" ThinkTime="0" Timeout="30" ParseDependentRequests="False" FollowRedirects="False" RecordResult="True" Cache="False" ResponseTimeGoal="0" Encoding="utf-8" ExpectedHttpStatusCode="200" ExpectedResponseUrl="" ReportingName="" IgnoreHttpStatusCode="False" />
</Items>
</WebTest>
XML
lifecycle {
ignore_changes = [
# Ignore changes to tags because there is a hidden-link tag that gets created by ARM
tags
]
}
}