-
Notifications
You must be signed in to change notification settings - Fork 39
/
threshold_profile_us.tf
176 lines (156 loc) · 6.78 KB
/
threshold_profile_us.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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
terraform {
# Require Terraform version 0.15.x (recommended)
required_version = "~> 0.15.0"
required_providers {
site24x7 = {
source = "site24x7/site24x7"
# Update the latest version from https://registry.terraform.io/providers/site24x7/site24x7/latest
}
}
}
// Authentication API doc - https://www.site24x7.com/help/api/#authentication
provider "site24x7" {
// (Required) The client ID will be looked up in the SITE24X7_OAUTH2_CLIENT_ID
// environment variable if the attribute is empty or omitted.
# oauth2_client_id = "<SITE24X7_OAUTH2_CLIENT_ID>"
// (Required) The client secret will be looked up in the SITE24X7_OAUTH2_CLIENT_SECRET
// environment variable if the attribute is empty or omitted.
# oauth2_client_secret = "<SITE24X7_OAUTH2_CLIENT_SECRET>"
// (Required) The refresh token will be looked up in the SITE24X7_OAUTH2_REFRESH_TOKEN
// environment variable if the attribute is empty or omitted.
# oauth2_refresh_token = "<SITE24X7_OAUTH2_REFRESH_TOKEN>"
// ZAAID of the customer under a MSP or BU
# zaaid = "1234"
// (Required) Specify the data center from which you have obtained your
// OAuth client credentials and refresh token. It can be (US/EU/IN/AU/CN/JP/CA).
data_center = "US"
// The minimum time to wait in seconds before retrying failed Site24x7 API requests.
retry_min_wait = 1
// The maximum time to wait in seconds before retrying failed Site24x7 API
// requests. This is the upper limit for the wait duration with exponential
// backoff.
retry_max_wait = 30
// Maximum number of Site24x7 API request retries to perform until giving up.
max_retries = 4
}
// Site24x7 Threshold Profile API doc](https://www.site24x7.com/help/api/#threshold-website))
resource "site24x7_threshold_profile" "website_threshold_profile_us" {
// (Required) Name of the profile
profile_name = "URL Threshold Profile - Terraform"
// (Required) Type of the profile - Denotes monitor type (eg) RESTAPI, SSL_CERT
type = "URL"
// (Optional) Threshold profile types - https://www.site24x7.com/help/api/#threshold_profile_types
// 1 - Static Threshold, 2 - AI-based Threshold
profile_type = 1
// (Optional) Triggers alert when the monitor is down from configured number of locations. Default value is '3'
down_location_threshold = 1
// (Optional) Triggers alert when Website content is modified.
website_content_modified = false
// (Optional) Triggers alert when not receiving the website entire HTTP response within 30 seconds.
read_time_out = {
severity = 3
value = true
}
// (Optional) Triggers alert when Website content changes by configured percentage.
website_content_changes {
severity = 2
value = 80
}
website_content_changes {
severity = 3
value = 95
}
// (Optional) Response time threshold configuration
primary_response_time_trouble_threshold = {
// https://www.site24x7.com/help/api/#threshold_severity
// 2 - Trouble
severity = 2
// https://www.site24x7.com/help/api/#constants
// 1 - Greater than (>), 2 - Less than (<), 3 - Greater than or equal to (>=), 4 - Less than or equal to (<=), 5 - Equal to (=), 6 - Not Equal to (≠)
comparison_operator = 2
// Attribute Threshold Value
value = 1000
// https://www.site24x7.com/help/api/#threshold_strategy
// 1 - Poll Count, 2 - Poll Average, 3 - Time Range, 4 - Average Time
strategy = 2
// Poll Check Value
polls_check = 5
}
primary_response_time_critical_threshold = {
// https://www.site24x7.com/help/api/#threshold_severity
// 3 - Critical
severity = 3
// https://www.site24x7.com/help/api/#constants
// 1 - Greater than (>), 2 - Less than (<), 3 - Greater than or equal to (>=), 4 - Less than or equal to (<=), 5 - Equal to (=), 6 - Not Equal to (≠)
comparison_operator = 1
// Attribute Threshold Value
value = 2000
// https://www.site24x7.com/help/api/#threshold_strategy
// 1 - Poll Count, 2 - Poll Average, 3 - Time Range, 4 - Average Time
strategy = 2
// Poll Check Value
polls_check = 5
}
secondary_response_time_trouble_threshold = {
// https://www.site24x7.com/help/api/#threshold_severity
// 2 - Trouble
severity = 2
// https://www.site24x7.com/help/api/#constants
// 1 - Greater than (>), 2 - Less than (<), 3 - Greater than or equal to (>=), 4 - Less than or equal to (<=), 5 - Equal to (=), 6 - Not Equal to (≠)
comparison_operator = 1
// Attribute Threshold Value
value = 3000
// https://www.site24x7.com/help/api/#threshold_strategy
// 1 - Poll Count, 2 - Poll Average, 3 - Time Range, 4 - Average Time
strategy = 2
// Poll Check Value
polls_check = 5
}
secondary_response_time_critical_threshold = {
// https://www.site24x7.com/help/api/#threshold_severity
// 3 - Critical
severity = 3
// https://www.site24x7.com/help/api/#constants
// 1 - Greater than (>), 2 - Less than (<), 3 - Greater than or equal to (>=), 4 - Less than or equal to (<=), 5 - Equal to (=), 6 - Not Equal to (≠)
comparison_operator = 1
// Attribute Threshold Value
value = 4000
// https://www.site24x7.com/help/api/#threshold_strategy
// 1 - Poll Count, 2 - Poll Average, 3 - Time Range, 4 - Average Time
strategy = 2
// Poll Check Value
polls_check = 5
}
}
// SSL Threshold Profile API doc](https://www.site24x7.com/help/api/#threshold-ssl-cert))
resource "site24x7_threshold_profile" "ssl_certificate_threshold_profile_us" {
// (Required) Name of the profile
profile_name = "SSL_CERT Thresh - Terraform"
// (Required) Type of the profile - Denotes monitor type (eg) RESTAPI, SSL_CERT
type = "SSL_CERT"
// (Optional) Triggers trouble alert before the SSL certificate expires within the configured number of days.
ssl_cert_days_until_expiry_trouble_threshold = {
severity = 2
value = 61
}
// (Optional) Triggers critical alert before the SSL certificate expires within the configured number of days.
ssl_cert_days_until_expiry_critical_threshold = {
severity = 3
value = 31
}
// (Optional) Triggers alert when the ssl certificate is modified.
ssl_cert_fingerprint_modified = false
}
// HEARTBEAT Threshold Profile API doc](https://www.site24x7.com/help/api/#threshold-heartbeat))
resource "site24x7_threshold_profile" "heartbeat_threshold" {
// (Required) Name of the profile
profile_name = "Heartbeat Threshold - Terraform"
// (Required) Type of the profile - Denotes monitor type (eg) RESTAPI, SSL_CERT
type = "HEARTBEAT"
// (Optional) Generate Trouble Alert if not pinged for more than x mins
trouble_if_not_pinged_more_than = 10
// (Optional) Generate Down Alert if not pinged for more than x mins
down_if_not_pinged_more_than = 20
// (Optional) Generate Trouble Alert if pinged within x mins
trouble_if_pinged_within = 15
}