Synthetic Monitoring checks are tests that run on selected probes at defined intervals and report metrics and logs back to your Grafana Cloud account. The target for checks can be a domain name, a server, or a website, depending on what information you would like to gather about your endpoint. You can define multiple checks for a single endpoint to check different capabilities.
data "grafana_synthetic_monitoring_probes" "main" {}
resource "grafana_synthetic_monitoring_check" "dns" {
job = "DNS Defaults"
target = "grafana.com"
enabled = false
probes = [
data.grafana_synthetic_monitoring_probes.main.probes.Atlanta,
]
labels = {
foo = "bar"
}
settings {
dns {}
}
}
data "grafana_synthetic_monitoring_probes" "main" {}
resource "grafana_synthetic_monitoring_check" "dns" {
job = "DNS Updated"
target = "grafana.net"
enabled = false
probes = [
data.grafana_synthetic_monitoring_probes.main.probes.Frankfurt,
data.grafana_synthetic_monitoring_probes.main.probes.London,
]
labels = {
foo = "baz"
}
settings {
dns {
ip_version = "Any"
server = "8.8.4.4"
port = 8600
record_type = "CNAME"
protocol = "TCP"
valid_r_codes = [
"NOERROR",
"NOTAUTH",
]
validate_answer_rrs {
fail_if_matches_regexp = [
".+-bad-stuff*",
]
fail_if_not_matches_regexp = [
".+-good-stuff*",
]
}
validate_authority_rrs {
fail_if_matches_regexp = [
".+-bad-stuff*",
]
fail_if_not_matches_regexp = [
".+-good-stuff*",
]
}
validate_additional_rrs {
fail_if_matches_regexp = [
".+-bad-stuff*",
]
fail_if_not_matches_regexp = [
".+-good-stuff*",
]
}
}
}
}
data "grafana_synthetic_monitoring_probes" "main" {}
resource "grafana_synthetic_monitoring_check" "http" {
job = "HTTP Defaults"
target = "https://grafana.com"
enabled = false
probes = [
data.grafana_synthetic_monitoring_probes.main.probes.Atlanta,
]
labels = {
foo = "bar"
}
settings {
http {}
}
}
data "grafana_synthetic_monitoring_probes" "main" {}
resource "grafana_synthetic_monitoring_check" "http" {
job = "HTTP Defaults"
target = "https://grafana.org"
enabled = false
probes = [
data.grafana_synthetic_monitoring_probes.main.probes.Bangalore,
data.grafana_synthetic_monitoring_probes.main.probes.Mumbai,
]
labels = {
foo = "bar"
}
settings {
http {
ip_version = "V6"
method = "TRACE"
body = "and spirit"
no_follow_redirects = true
bearer_token = "asdfjkl;"
proxy_url = "https://almost-there"
fail_if_ssl = true
fail_if_not_ssl = true
cache_busting_query_param_name = "pineapple"
tls_config {
server_name = "grafana.org"
client_cert = <<EOS
-----BEGIN CERTIFICATE-----
MIIEljCCAn4CCQCKJPUQQxeO0zANBgkqhkiG9w0BAQsFADANMQswCQYDVQQGEwJT
RTAeFw0yMTA1MjkxOTIyNTdaFw0yNDAzMTgxOTIyNTdaMA0xCzAJBgNVBAYTAlNF
MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAnmbazDNUT0rSI4BpGZK+
0AJ+9FDkIYWJUtRLJoxw8CF+AobMFploYA2L2Myt80cTA1w8FrewjC8qlqdnrPWr
h1ely2zsUljgi1/niH0ndjFzliL7UkinXQiAsTtYOrOQmzyd/o5PNdu7dz0m7stD
BN/Sz5TlXZnA1/eJbqV/kqMau6b1MaBx8SbRfUG9+cSmUobFJwuktDrPuwJhcEkl
iDmhEqu1GuZzmKvzPacLTVia1vSlmCTCu89NiHI8iGiiLtqNrapup7f8j5m3a3SL
a+vXhplFj2piNl7Nc0dfuVgtEliTI+qUL2/+4A7gzRWZpHy21/LxMMXmBhdJW9En
FWkev97VZLgb5TR3+qpSWmXcodjPy4dibvwsOMpdd+Q4AYulwvlDw5idRPVgGvk7
qq03+w9ppZ5Fugws9k2CD9F/75JX2mCbRpkuPe8XXZ7bqrMaQgQMLOrs68HuiiCk
FTklglq4DMKxnf/Y/T/MgIa9Q1o28YSevh6A7FnfPGARj2H2T4rToi+bC1Vf7qNB
Z18bDpz99tRUTbyiRUSBMWLCGhU6c4HAqUrfrkpperOKFBQ3i38a79838oFdXHBW
6rx1t5cC3XwtEoUyeBKAygez8G1LDXbN3607MxVhAjhHKtPkYvuBfysSNU6JrR0z
UV1IURJANt2UMuKgSEkG/IMCAwEAATANBgkqhkiG9w0BAQsFAAOCAgEAcipMhp/w
yzfPy61faVAw9SPaMNRlnW9FCDC3N9CGOjo2knjXpObPzyzsJiUURTjrA9eFMpRA
e2Rgn2j+nvm2XdLAlC4Kh8jqv/wCL0X6BTQMdN5aOhXdSiXtpXOMvXYY/dQ4ebRZ
XeRCVWQD79JbV6/uyx0nCV3FVcU7L1P4UjxroefVr0soLPMirgxHmOxLnkoVgdcB
tqufP5kJx9CIeJXPx3QQsk1XfEtxtUvuw4ZaZkQnNUqvGl7V+AZpur5Eqfv3zBi8
QxxL7qGkARNssNWH2Ju+tqpM/UZRnjlFrDR4SXUgT0coTduBalUY6qHkciHmRpiP
tf3SgpDeiCSOV2iVFGdaR1mz3muWoAYWFstcWN3a3HjjVugIi23yLN8Gv8CNeoH4
prulinFCLrFgAh8SLAF8mOAZanT06LH8jOIFYrdUxH+ZeRBR0rLoFjUF+JB7UKD9
5TA+B4EBzQ1tMbGFU1DX79MjAejq0IV0Nzq+GMfBvLHxEf4+Oz8nqhDXQcJ6TdtY
l3Lyw5zBvOL80SBK+Mr0UP7d9U3VXgbGHCYVJU6Ot1TwiGwahtWALRALA3TWeGkq
7kyD1H+nm+9lfKhuyBRQnRGBVyze2lAp7oxwshJuhBwEXosXFxq1Cy6QhPN77r6N
vuhxvtppolNnyOgGxwG4zquqq2V5/+vKjKY=
-----END CERTIFICATE-----
EOS
}
headers = [
"Content-Type: multipart/form-data; boundary=something",
]
basic_auth {
username = "open"
password = "sesame"
}
valid_status_codes = [
200,
201,
]
valid_http_versions = [
"HTTP/1.0",
"HTTP/1.1",
"HTTP/2.0",
]
fail_if_body_matches_regexp = [
".*bad stuff.*",
]
fail_if_body_not_matches_regexp = [
".*good stuff.*",
]
fail_if_header_matches_regexp {
header = "Content-Type"
regexp = "application/soap*"
allow_missing = true
}
}
}
}
data "grafana_synthetic_monitoring_probes" "main" {}
resource "grafana_synthetic_monitoring_check" "ping" {
job = "Ping Defaults"
target = "grafana.com"
enabled = false
probes = [
data.grafana_synthetic_monitoring_probes.main.probes.Atlanta,
]
labels = {
foo = "bar"
}
settings {
ping {}
}
}
data "grafana_synthetic_monitoring_probes" "main" {}
resource "grafana_synthetic_monitoring_check" "ping" {
job = "Ping Updated"
target = "grafana.net"
enabled = false
probes = [
data.grafana_synthetic_monitoring_probes.main.probes.Frankfurt,
data.grafana_synthetic_monitoring_probes.main.probes.London,
]
labels = {
foo = "baz"
}
settings {
ping {
ip_version = "Any"
payload_size = 20
dont_fragment = true
}
}
}
data "grafana_synthetic_monitoring_probes" "main" {}
resource "grafana_synthetic_monitoring_check" "tcp" {
job = "TCP Defaults"
target = "grafana.com:80"
enabled = false
probes = [
data.grafana_synthetic_monitoring_probes.main.probes.Atlanta,
]
labels = {
foo = "bar"
}
settings {
tcp {}
}
}
data "grafana_synthetic_monitoring_probes" "main" {}
resource "grafana_synthetic_monitoring_check" "tcp" {
job = "TCP Defaults"
target = "grafana.com:443"
enabled = false
probes = [
data.grafana_synthetic_monitoring_probes.main.probes.Frankfurt,
data.grafana_synthetic_monitoring_probes.main.probes.London,
]
labels = {
foo = "baz"
}
settings {
tcp {
ip_version = "V6"
tls = true
query_response {
send = "howdy"
expect = "hi"
}
query_response {
send = "like this"
expect = "like that"
start_tls = true
}
tls_config {
server_name = "grafana.com"
ca_cert = <<EOS
-----BEGIN CERTIFICATE-----
MIIEljCCAn4CCQCKJPUQQxeO0zANBgkqhkiG9w0BAQsFADANMQswCQYDVQQGEwJT
RTAeFw0yMTA1MjkxOTIyNTdaFw0yNDAzMTgxOTIyNTdaMA0xCzAJBgNVBAYTAlNF
MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAnmbazDNUT0rSI4BpGZK+
0AJ+9FDkIYWJUtRLJoxw8CF+AobMFploYA2L2Myt80cTA1w8FrewjC8qlqdnrPWr
h1ely2zsUljgi1/niH0ndjFzliL7UkinXQiAsTtYOrOQmzyd/o5PNdu7dz0m7stD
BN/Sz5TlXZnA1/eJbqV/kqMau6b1MaBx8SbRfUG9+cSmUobFJwuktDrPuwJhcEkl
iDmhEqu1GuZzmKvzPacLTVia1vSlmCTCu89NiHI8iGiiLtqNrapup7f8j5m3a3SL
a+vXhplFj2piNl7Nc0dfuVgtEliTI+qUL2/+4A7gzRWZpHy21/LxMMXmBhdJW9En
FWkev97VZLgb5TR3+qpSWmXcodjPy4dibvwsOMpdd+Q4AYulwvlDw5idRPVgGvk7
qq03+w9ppZ5Fugws9k2CD9F/75JX2mCbRpkuPe8XXZ7bqrMaQgQMLOrs68HuiiCk
FTklglq4DMKxnf/Y/T/MgIa9Q1o28YSevh6A7FnfPGARj2H2T4rToi+bC1Vf7qNB
Z18bDpz99tRUTbyiRUSBMWLCGhU6c4HAqUrfrkpperOKFBQ3i38a79838oFdXHBW
6rx1t5cC3XwtEoUyeBKAygez8G1LDXbN3607MxVhAjhHKtPkYvuBfysSNU6JrR0z
UV1IURJANt2UMuKgSEkG/IMCAwEAATANBgkqhkiG9w0BAQsFAAOCAgEAcipMhp/w
yzfPy61faVAw9SPaMNRlnW9FCDC3N9CGOjo2knjXpObPzyzsJiUURTjrA9eFMpRA
e2Rgn2j+nvm2XdLAlC4Kh8jqv/wCL0X6BTQMdN5aOhXdSiXtpXOMvXYY/dQ4ebRZ
XeRCVWQD79JbV6/uyx0nCV3FVcU7L1P4UjxroefVr0soLPMirgxHmOxLnkoVgdcB
tqufP5kJx9CIeJXPx3QQsk1XfEtxtUvuw4ZaZkQnNUqvGl7V+AZpur5Eqfv3zBi8
QxxL7qGkARNssNWH2Ju+tqpM/UZRnjlFrDR4SXUgT0coTduBalUY6qHkciHmRpiP
tf3SgpDeiCSOV2iVFGdaR1mz3muWoAYWFstcWN3a3HjjVugIi23yLN8Gv8CNeoH4
prulinFCLrFgAh8SLAF8mOAZanT06LH8jOIFYrdUxH+ZeRBR0rLoFjUF+JB7UKD9
5TA+B4EBzQ1tMbGFU1DX79MjAejq0IV0Nzq+GMfBvLHxEf4+Oz8nqhDXQcJ6TdtY
l3Lyw5zBvOL80SBK+Mr0UP7d9U3VXgbGHCYVJU6Ot1TwiGwahtWALRALA3TWeGkq
7kyD1H+nm+9lfKhuyBRQnRGBVyze2lAp7oxwshJuhBwEXosXFxq1Cy6QhPN77r6N
vuhxvtppolNnyOgGxwG4zquqq2V5/+vKjKY=
-----END CERTIFICATE-----
EOS
}
}
}
}
data "grafana_synthetic_monitoring_probes" "main" {}
resource "grafana_synthetic_monitoring_check" "traceroute" {
job = "Traceroute defaults"
target = "grafana.com"
enabled = false
frequency = 120000
timeout = 30000
probes = [
data.grafana_synthetic_monitoring_probes.main.probes.Atlanta,
]
labels = {
foo = "bar"
}
settings {
traceroute {}
}
}
data "grafana_synthetic_monitoring_probes" "main" {}
resource "grafana_synthetic_monitoring_check" "traceroute" {
job = "Traceroute complex"
target = "grafana.net"
enabled = false
frequency = 120000
timeout = 30000
probes = [
data.grafana_synthetic_monitoring_probes.main.probes.Frankfurt,
data.grafana_synthetic_monitoring_probes.main.probes.London,
]
labels = {
foo = "baz"
}
settings {
traceroute {
max_hops = 25
max_unknown_hops = 10
ptr_lookup = false
}
}
}
job
(String) Name used for job label.probes
(Set of Number) List of probe location IDs where this target will be checked from.settings
(Block Set, Min: 1, Max: 1) Check settings. Should contain exactly one nested block. (see below for nested schema)target
(String) Hostname to ping.alert_sensitivity
(String) Can be set to none
, low
, medium
, or high
to correspond to the check alert levels. Defaults to none
.basic_metrics_only
(Boolean) Metrics are reduced by default. Set this to false
if you'd like to publish all metrics. We maintain a full list of metrics collected for each. Defaults to true
.enabled
(Boolean) Whether to enable the check. Defaults to true
.frequency
(Number) How often the check runs in milliseconds (the value is not truly a "frequency" but a "period"). The minimum acceptable value is 1 second (1000 ms), and the maximum is 120 seconds (120000 ms). Defaults to 60000
.labels
(Map of String) Custom labels to be included with collected metrics and logs. The maximum number of labels that can be specified per check is 5. These are applied, along with the probe-specific labels, to the outgoing metrics. The names and values of the labels cannot be empty, and the maximum length is 32 bytes.timeout
(Number) Specifies the maximum running time for the check in milliseconds. The minimum acceptable value is 1 second (1000 ms), and the maximum 10 seconds (10000 ms). Defaults to 3000
.id
(String) The ID of the check.tenant_id
(Number) The tenant ID of the check.settings
Optional:
dns
(Block Set, Max: 1) Settings for DNS check. The target must be a valid hostname (or IP address for PTR
records). (see below for nested schema)http
(Block Set, Max: 1) Settings for HTTP check. The target must be a URL (http or https). (see below for nested schema)multihttp
(Block Set, Max: 1) Settings for MultiHTTP check. The target must be a URL (http or https) (see below for nested schema)ping
(Block Set, Max: 1) Settings for ping (ICMP) check. The target must be a valid hostname or IP address. (see below for nested schema)tcp
(Block Set, Max: 1) Settings for TCP check. The target must be of the form <host>:<port>
, where the host portion must be a valid hostname or IP address. (see below for nested schema)traceroute
(Block Set, Max: 1) Settings for traceroute check. The target must be a valid hostname or IP address (see below for nested schema)settings.dns
Optional:
ip_version
(String) Options are V4
, V6
, Any
. Specifies whether the corresponding check will be performed using IPv4 or IPv6. The Any
value indicates that IPv6 should be used, falling back to IPv4 if that's not available. Defaults to V4
.port
(Number) Port to target. Defaults to 53
.protocol
(String) TCP
or UDP
. Defaults to UDP
.record_type
(String) One of ANY
, A
, AAAA
, CNAME
, MX
, NS
, PTR
, SOA
, SRV
, TXT
. Defaults to A
.server
(String) DNS server address to target. Defaults to 8.8.8.8
.source_ip_address
(String) Source IP address.valid_r_codes
(Set of String) List of valid response codes. Options include NOERROR
, BADALG
, BADMODE
, BADKEY
, BADCOOKIE
, BADNAME
, BADSIG
, BADTIME
, BADTRUNC
, BADVERS
, FORMERR
, NOTIMP
, NOTAUTH
, NOTZONE
, NXDOMAIN
, NXRRSET
, REFUSED
, SERVFAIL
, YXDOMAIN
, YXRRSET
.validate_additional_rrs
(Block Set) Validate additional matches. (see below for nested schema)validate_answer_rrs
(Block Set, Max: 1) Validate response answer. (see below for nested schema)validate_authority_rrs
(Block Set, Max: 1) Validate response authority. (see below for nested schema)settings.dns.validate_additional_rrs
Optional:
fail_if_matches_regexp
(Set of String) Fail if value matches regex.fail_if_not_matches_regexp
(Set of String) Fail if value does not match regex.settings.dns.validate_answer_rrs
Optional:
fail_if_matches_regexp
(Set of String) Fail if value matches regex.fail_if_not_matches_regexp
(Set of String) Fail if value does not match regex.settings.dns.validate_authority_rrs
Optional:
fail_if_matches_regexp
(Set of String) Fail if value matches regex.fail_if_not_matches_regexp
(Set of String) Fail if value does not match regex.settings.http
Optional:
basic_auth
(Block Set, Max: 1) Basic auth settings. (see below for nested schema)bearer_token
(String) Token for use with bearer authorization header.body
(String) The body of the HTTP request used in probe.cache_busting_query_param_name
(String) The name of the query parameter used to prevent the server from using a cached response. Each probe will assign a random value to this parameter each time a request is made.fail_if_body_matches_regexp
(Set of String) List of regexes. If any match the response body, the check will fail.fail_if_body_not_matches_regexp
(Set of String) List of regexes. If any do not match the response body, the check will fail.fail_if_header_matches_regexp
(Block Set) Check fails if headers match. (see below for nested schema)fail_if_header_not_matches_regexp
(Block Set) Check fails if headers do not match. (see below for nested schema)fail_if_not_ssl
(Boolean) Fail if SSL is not present. Defaults to false
.fail_if_ssl
(Boolean) Fail if SSL is present. Defaults to false
.headers
(Set of String) The HTTP headers set for the probe.ip_version
(String) Options are V4
, V6
, Any
. Specifies whether the corresponding check will be performed using IPv4 or IPv6. The Any
value indicates that IPv6 should be used, falling back to IPv4 if that's not available. Defaults to V4
.method
(String) Request method. One of GET
, CONNECT
, DELETE
, HEAD
, OPTIONS
, POST
, PUT
, TRACE
Defaults to GET
.no_follow_redirects
(Boolean) Do not follow redirects. Defaults to false
.proxy_connect_headers
(Set of String) The HTTP headers sent to the proxy URLproxy_url
(String) Proxy URL.tls_config
(Block Set, Max: 1) TLS config. (see below for nested schema)valid_http_versions
(Set of String) List of valid HTTP versions. Options include HTTP/1.0
, HTTP/1.1
, HTTP/2.0
valid_status_codes
(Set of Number) Accepted status codes. If unset, defaults to 2xx.settings.http.basic_auth
Required:
password
(String) Basic auth password.username
(String) Basic auth username.settings.http.fail_if_header_matches_regexp
Required:
header
(String) Header name.regexp
(String) Regex that header value should match.Optional:
allow_missing
(Boolean) Allow header to be missing from responses. Defaults to false
.settings.http.fail_if_header_not_matches_regexp
Required:
header
(String) Header name.regexp
(String) Regex that header value should match.Optional:
allow_missing
(Boolean) Allow header to be missing from responses. Defaults to false
.settings.http.tls_config
Optional:
ca_cert
(String) CA certificate in PEM format.client_cert
(String) Client certificate in PEM format.client_key
(String, Sensitive) Client key in PEM format.insecure_skip_verify
(Boolean) Disable target certificate validation. Defaults to false
.server_name
(String) Used to verify the hostname for the targets.settings.multihttp
Optional:
entries
(Block List) (see below for nested schema)settings.multihttp.entries
Optional:
assertions
(Block List) Assertions to make on the request response (see below for nested schema)request
(Block Set, Max: 1) An individual MultiHTTP request (see below for nested schema)variables
(Block List) Variables to extract from the request response (see below for nested schema)settings.multihttp.entries.assertions
Required:
type
(String) The type of assertion to make: TEXT, JSON_PATH_VALUE, JSON_PATH_ASSERTION, REGEX_ASSERTIONOptional:
condition
(String) The condition of the assertion: NOT_CONTAINS, EQUALS, STARTS_WITH, ENDS_WITH, TYPE_OF, CONTAINSexpression
(String) The expression of the assertion. Should start with $.subject
(String) The subject of the assertion: RESPONSE_HEADERS, HTTP_STATUS_CODE, RESPONSE_BODYvalue
(String) The value of the assertionsettings.multihttp.entries.request
Required:
method
(String) The HTTP method to useurl
(String) The URL for the requestOptional:
body
(Block Set) The body of the HTTP request used in probe. (see below for nested schema)headers
(Block Set) The headers to send with the request (see below for nested schema)query_fields
(Block Set) Query fields to send with the request (see below for nested schema)settings.multihttp.entries.request.body
Optional:
content_encoding
(String) The content encoding of the bodycontent_type
(String) The content type of the bodypayload
(String) The body payloadsettings.multihttp.entries.request.headers
Required:
name
(String) Name of the header to sendvalue
(String) Value of the header to sendsettings.multihttp.entries.request.query_fields
Required:
name
(String) Name of the query field to sendvalue
(String) Value of the query field to sendsettings.multihttp.entries.variables
Required:
type
(String) The method of finding the variable value to extract. JSON_PATH, REGEX, CSS_SELECTOROptional:
attribute
(String) The attribute to use when finding the variable value. Only used when type is CSS_SELECTORexpression
(String) The expression to when finding the variable. Should start with $. Only use when type is JSON_PATH or REGEXname
(String) The name of the variable to extractsettings.ping
Optional:
dont_fragment
(Boolean) Set the DF-bit in the IP-header. Only works with ipV4. Defaults to false
.ip_version
(String) Options are V4
, V6
, Any
. Specifies whether the corresponding check will be performed using IPv4 or IPv6. The Any
value indicates that IPv6 should be used, falling back to IPv4 if that's not available. Defaults to V4
.payload_size
(Number) Payload size. Defaults to 0
.source_ip_address
(String) Source IP address.settings.tcp
Optional:
ip_version
(String) Options are V4
, V6
, Any
. Specifies whether the corresponding check will be performed using IPv4 or IPv6. The Any
value indicates that IPv6 should be used, falling back to IPv4 if that's not available. Defaults to V4
.query_response
(Block Set) The query sent in the TCP probe and the expected associated response. (see below for nested schema)source_ip_address
(String) Source IP address.tls
(Boolean) Whether or not TLS is used when the connection is initiated. Defaults to false
.tls_config
(Block Set, Max: 1) TLS config. (see below for nested schema)settings.tcp.query_response
Required:
expect
(String) Response to expect.send
(String) Data to send.Optional:
start_tls
(Boolean) Upgrade TCP connection to TLS. Defaults to false
.settings.tcp.tls_config
Optional:
ca_cert
(String) CA certificate in PEM format.client_cert
(String) Client certificate in PEM format.client_key
(String, Sensitive) Client key in PEM format.insecure_skip_verify
(Boolean) Disable target certificate validation. Defaults to false
.server_name
(String) Used to verify the hostname for the targets.settings.traceroute
Optional:
max_hops
(Number) Maximum TTL for the trace Defaults to 64
.max_unknown_hops
(Number) Maximum number of hosts to travers that give no response Defaults to 15
.ptr_lookup
(Boolean) Reverse lookup hostnames from IP addresses Defaults to true
.data "grafana_synthetic_monitoring_probes" "main" {}
resource "grafana_synthetic_monitoring_check" "multihttp" {
job = "multihttp basic"
target = "https://www.grafana-dev.com"
enabled = false
probes = [
data.grafana_synthetic_monitoring_probes.main.probes.Amsterdam,
]
labels = {
foo = "bar"
}
settings {
multihttp {
entries {
request {
method = "GET"
url = "https://www.grafana-dev.com"
}
}
}
}
}
data "grafana_synthetic_monitoring_probes" "main" {}
resource "grafana_synthetic_monitoring_check" "multihttp" {
job = "multihttp complex"
target = "https://www.an-auth-endpoint.com"
enabled = false
probes = [
data.grafana_synthetic_monitoring_probes.main.probes.Amsterdam,
]
labels = {
foo = "bar"
}
settings {
multihttp {
entries {
request {
method = "POST"
url = "https://www.an-auth-endpoint.com"
query_fields {
name = "username"
value = "steve"
}
query_fields {
name = "password"
value = "top_secret"
}
body {
content_type = "application/json"
}
}
assertions {
type = "TEXT"
subject = "HTTP_STATUS_CODE"
condition = "EQUALS"
value = "200"
}
variables {
type = "JSON_PATH"
name = "accessToken"
expression = "data.accessToken"
}
}
entries {
request {
method = "GET"
url = "https://www.an-endpoint-that-requires-auth.com"
headers {
name = "Authorization"
value = "Bearer $${accessToken}"
}
}
assertions {
type = "TEXT"
subject = "RESPONSE_BODY"
condition = "CONTAINS"
value = "foobar"
}
assertions {
type = "TEXT"
subject = "RESPONSE_BODY"
condition = "NOT_CONTAINS"
value = "xyyz"
}
assertions {
type = "JSON_PATH_VALUE"
condition = "EQUALS"
expression = "$.slideshow.author"
value = "Yours Truly"
}
assertions {
type = "JSON_PATH_VALUE"
condition = "STARTS_WITH"
expression = "$.slideshow.date"
value = "date of "
}
assertions {
type = "JSON_PATH_ASSERTION"
expression = "$.slideshow.slides"
}
}
}
}
}
Import is supported using the following syntax:
terraform import grafana_synthetic_monitoring_check.name "{{ id }}"