-
Notifications
You must be signed in to change notification settings - Fork 39
/
website_monitor_us.tf
273 lines (215 loc) · 10.6 KB
/
website_monitor_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
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
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" {
// (Security recommendation - It is always best practice to store your credentials in a Vault of your choice.)
// (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>"
// (Security recommendation - It is always best practice to store your credentials in a Vault of your choice.)
// (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>"
// (Security recommendation - It is always best practice to store your credentials in a Vault of your choice.)
// (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>"
// (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"
// (Optional) ZAAID of the customer under a MSP or BU
zaaid = "1234"
// (Optional) The minimum time to wait in seconds before retrying failed Site24x7 API requests.
retry_min_wait = 1
// (Optional) 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
// (Optional) Maximum number of Site24x7 API request retries to perform until giving up.
max_retries = 4
}
// Website Monitor API doc: https://www.site24x7.com/help/api/#website
resource "site24x7_website_monitor" "website_monitor_example" {
// (Required) Display name for the monitor
display_name = "Example Monitor"
// (Required) Website address to monitor.
website = "https://www.example.com"
// (Optional) Interval at which your website has to be monitored.
// See https://www.site24x7.com/help/api/#check-interval for all supported values.
check_frequency = "1"
// (Optional) Name of the Location Profile that has to be associated with the monitor.
// Either specify location_profile_id or location_profile_name.
// If location_profile_id and location_profile_name are omitted,
// the first profile returned by the /api/location_profiles endpoint
// (https://www.site24x7.com/help/api/#list-of-all-location-profiles) will be
// used.
location_profile_name = "North America"
}
// Website Monitor API doc: https://www.site24x7.com/help/api/#website
resource "site24x7_website_monitor" "website_monitor" {
// (Required) Display name for the monitor
display_name = "mymonitor"
// (Required) Website address to monitor.
website = "https://foo.bar"
// (Optional) Check interval for monitoring. Default: 1. See
// https://www.site24x7.com/help/api/#check-interval for all supported
// values.
check_frequency = "1"
// (Optional) Authentication user name to access the website.
auth_user = "theuser"
// (Optional) Authentication password to access the website.
auth_pass = "thepasswd"
// (Optional) Check for the keyword in the website response.
matching_keyword_value = "foo"
// (Optional) Alert type to match on. See
// https://www.site24x7.com/help/api/#alert-type-constants for available
// values.
matching_keyword_severity = 2
// (Optional) Check for non existence of keyword in the website response.
unmatching_keyword_value = "error"
// (Optional) Alert type to match on. See
// https://www.site24x7.com/help/api/#alert-type-constants for available
// values.
unmatching_keyword_severity = 2
// (Optional) Match the regular expression in the website response.
match_regex_value = ".*imprint.*"
// (Optional) Alert type to match on. See
// https://www.site24x7.com/help/api/#alert-type-constants for available
// values.
match_regex_severity = 2
// (Optional) Perform case sensitive keyword search or not. Default: false.
match_case = true
// (Optional) User Agent to be used while monitoring the website.
user_agent = "some user agent string"
// (Optional) Monitoring is performed over IPv6 from supported locations. IPv6 locations do not fall back to IPv4 on failure.
use_ipv6 = false
// (Optional) Monitoring is performed over the selected internet protocol
// 0|Monitoring is performed over IPv4 from supported locations
// 1|Monitoring is performed over IPv6 from supported locations
// 2|IPv4 or IPv6 option will help in flexibly switching to the protocol that is supported in a particular location if one protocol fails.
// 3|IPv4 and IPv6 will create two connections for each protocol.
ip_type = 3
// (Optional) Choose the primary internet protocol for the resources. Select only if you're choosing the option, Both IPv4 and IPv6 monitoring.
// Options :
// 0|IPv4
// 1|IPv6
primary_protocol =_1
// (Optional) Configure the change for the secondary resource for which you'd like to get notifications. Select only if you're choosing the option,Both IPv4 and IPv6 monitoring.
// Options :
// 2|Trouble
// 3|Critical
secondary_protocol_severity = 2
// (Optional) Timeout for connecting to website. Range 1 - 45. Default: 10
timeout = 10
// (Optional) Location Profile to be associated with the monitor. If
// location_profile_id and location_profile_name are omitted,
// the first profile returned by the /api/location_profiles endpoint
// (https://www.site24x7.com/help/api/#list-of-all-location-profiles) will be
// used.
location_profile_id = "123"
// (Optional) Name of the Location Profile that has to be associated with the monitor.
// Either specify location_profile_id or location_profile_name.
// If location_profile_id and location_profile_name are omitted,
// the first profile returned by the /api/location_profiles endpoint
// (https://www.site24x7.com/help/api/#list-of-all-location-profiles) will be
// used.
location_profile_name = "North America"
// (Optional) Notification profile to be associated with the monitor. If
// omitted, the first profile returned by the /api/notification_profiles
// endpoint (https://www.site24x7.com/help/api/#list-notification-profiles)
// will be used.
notification_profile_id = "123"
// (Optional) Name of the notification profile that has to be associated with the monitor.
// Profile name matching works for both exact and partial match.
// Either specify notification_profile_id or notification_profile_name.
// If notification_profile_id and notification_profile_name are omitted,
// the first profile returned by the /api/notification_profiles endpoint
// (https://www.site24x7.com/help/api/#list-notification-profiles) will be
// used.
notification_profile_name = "Terraform Profile"
// (Optional) Threshold profile to be associated with the monitor. If
// omitted, the first profile returned by the /api/threshold_profiles
// endpoint for the website monitor (https://www.site24x7.com/help/api/#list-threshold-profiles) will
// be used.
threshold_profile_id = "123"
// (Optional) List of monitor group IDs to associate the monitor to.
monitor_groups = [
"123",
"456"
]
// (Optional) List of dependent resource IDs. Suppress alert when dependent monitor(s) is down.
dependency_resource_ids = [
"123",
"456"
]
// (Optional) List if user group IDs to be notified on down.
// Either specify user_group_ids or user_group_names. If omitted, the
// first user group returned by the /api/user_groups endpoint
// (https://www.site24x7.com/help/api/#list-of-all-user-groups) will be used.
user_group_ids = [
"123",
]
// (Optional) List if user group names to be notified on down.
// Either specify user_group_ids or user_group_names. If omitted, the
// first user group returned by the /api/user_groups endpoint
// (https://www.site24x7.com/help/api/#list-of-all-user-groups) will be used.
user_group_names = [
"Terraform",
"Network",
"Admin",
]
// (Optional) List if tag IDs to be associated to the monitor.
tag_ids = [
"123",
]
// (Optional) List of tag names to be associated to the monitor. Tag name matching works for both exact and
// partial match. Either specify tag_ids or tag_names.
tag_names = [
"Terraform",
"Network",
]
// (Optional) List of Third Party Service IDs to be associated to the monitor.
third_party_service_ids = [
"4567"
]
// (Optional) Map of status to actions that should be performed on monitor
// status changes. See
// https://www.site24x7.com/help/api/#action-rule-constants for all available
// status values.
actions = {
"1" = "123"
}
// (Optional) Resolve the IP address using Domain Name Server. Default: true.
use_name_server = false
// (Optional) Enter true to follow up to 10 HTTP redirection responses or false not to follow HTTP redirections. Default value is true.
follow_http_redirection = false
// (Optional) Enter true or false to Trust the Server SSL Certificate. Default value is true.
ignore_cert_err = true
// (Optional) Provide a comma-separated list of HTTP status codes that indicate a successful response. You can specify individual status codes, as well as ranges separated with a colon. Default: ""
up_status_codes = "200,404"
// (Optional) HTTP Method to be used for accessing the website. Default value is 'G'. 'G' denotes GET, 'P' denotes POST and 'H' denotes HEAD. PUT, PATCH and DELETE are not supported.
// See https://www.site24x7.com/help/api/#http_methods for allowed values.
http_method = "P"
// (Optional) Provide content type for request params when http_method is 'P'. 'J' denotes JSON, 'T' denotes TEXT, 'X' denotes XML and 'F' denotes FORM
request_content_type = "J"
// (Optional) Provide the content to be passed in the request body while accessing the website.
request_body = "{\"user_name\":\"joe\"}"
// (Optional) Map of custom HTTP headers to send.
request_headers = {
"Accept" = "application/json"
}
// (Optional) Map of HTTP response headers to check.
response_headers_severity = 0 // Can take values 0 or 2. '0' denotes Down and '2' denotes Trouble.
response_headers = {
"Content-Encoding" = "gzip"
"Connection" = "Keep-Alive"
}
}