Provides a Datadog synthetics test resource. This can be used to create and manage Datadog synthetics test.
Starting from version 3.1.0+, the direct usage of global variables in the configuration is deprecated, in favor of
local variables of type global
. As an example, if you were previously using {{ GLOBAL_VAR }}
directly in your
configuration, add a config_variable
of type global
with the id
matching the id
of the global variable GLOBAL_VAR
, which can be found in the Synthetics UI or from the output of the datadog_synthetics_global_variable
resource. The name can be chosen freely.
In practice, it means going from (simplified configuration):
url = https://{{ GLOBAL_VAR }}
to
config_variable {
name = "LOCAL_VAR"
id = [your_global_variable_id]
type = "global"
}
which you can now use in your request definition:
url = https://{{ LOCAL_VAR }}
# Example Usage (Synthetics API test)
# Create a new Datadog Synthetics API/HTTP test on https://www.example.org
resource "datadog_synthetics_test" "test_uptime" {
name = "An Uptime test on example.org"
type = "api"
subtype = "http"
status = "live"
message = "Notify @pagerduty"
locations = ["aws:eu-central-1"]
tags = ["foo:bar", "foo", "env:test"]
request_definition {
method = "GET"
url = "https://www.example.org"
}
request_headers = {
Content-Type = "application/json"
}
assertion {
type = "statusCode"
operator = "is"
target = "200"
}
options_list {
tick_every = 900
retry {
count = 2
interval = 300
}
monitor_options {
renotify_interval = 120
}
}
}
# Example Usage (Authenticated API test)
# Create a new Datadog Synthetics API/HTTP test on https://www.example.org
resource "datadog_synthetics_test" "test_api" {
name = "An API test on example.org"
type = "api"
subtype = "http"
status = "live"
message = "Notify @pagerduty"
locations = ["aws:eu-central-1"]
tags = ["foo:bar", "foo", "env:test"]
request_definition {
method = "GET"
url = "https://www.example.org"
}
request_headers = {
Content-Type = "application/json"
Authentication = "Token: 1234566789"
}
assertion {
type = "statusCode"
operator = "is"
target = "200"
}
options_list {
tick_every = 900
retry {
count = 2
interval = 300
}
monitor_options {
renotify_interval = 120
}
}
}
# Example Usage (Synthetics SSL test)
# Create a new Datadog Synthetics API/SSL test on example.org
resource "datadog_synthetics_test" "test_ssl" {
name = "An API test on example.org"
type = "api"
subtype = "ssl"
status = "live"
message = "Notify @pagerduty"
locations = ["aws:eu-central-1"]
tags = ["foo:bar", "foo", "env:test"]
request_definition {
host = "example.org"
port = 443
}
assertion {
type = "certificate"
operator = "isInMoreThan"
target = 30
}
options_list {
tick_every = 900
accept_self_signed = true
}
}
# Example Usage (Synthetics TCP test)
# Create a new Datadog Synthetics API/TCP test on example.org
resource "datadog_synthetics_test" "test_tcp" {
name = "An API test on example.org"
type = "api"
subtype = "tcp"
status = "live"
message = "Notify @pagerduty"
locations = ["aws:eu-central-1"]
tags = ["foo:bar", "foo", "env:test"]
request_definition {
host = "example.org"
port = 443
}
assertion {
type = "responseTime"
operator = "lessThan"
target = 2000
}
config_variable {
type = "global"
name = "MY_GLOBAL_VAR"
id = "76636cd1-82e2-4aeb-9cfe-51366a8198a2"
}
options_list {
tick_every = 900
}
}
# Example Usage (Synthetics DNS test)
# Create a new Datadog Synthetics API/DNS test on example.org
resource "datadog_synthetics_test" "test_dns" {
name = "An API test on example.org"
type = "api"
subtype = "dns"
status = "live"
message = "Notify @pagerduty"
locations = ["aws:eu-central-1"]
tags = ["foo:bar", "foo", "env:test"]
request_definition {
host = "example.org"
}
assertion {
type = "recordSome"
operator = "is"
property = "A"
target = "0.0.0.0"
}
options_list {
tick_every = 900
}
}
# Example Usage (Synthetics Multistep API test)
# Create a new Datadog Synthetics Multistep API test
resource "datadog_synthetics_test" "test_multi_step" {
name = "Multistep API test"
type = "api"
subtype = "multi"
status = "live"
locations = ["aws:eu-central-1"]
tags = ["foo:bar", "foo", "env:test"]
api_step {
name = "An API test on example.org"
subtype = "http"
assertion {
type = "statusCode"
operator = "is"
target = "200"
}
request_definition {
method = "GET"
url = "https://example.org"
}
request_headers = {
Content-Type = "application/json"
Authentication = "Token: 1234566789"
}
}
api_step {
name = "An API test on example.org"
subtype = "http"
assertion {
type = "statusCode"
operator = "is"
target = "200"
}
request_definition {
method = "GET"
url = "http://example.org"
}
}
options_list {
tick_every = 900
accept_self_signed = true
}
}
# Example Usage (Synthetics Browser test)
# Create a new Datadog Synthetics Browser test starting on https://www.example.org
resource "datadog_synthetics_test" "test_browser" {
name = "A Browser test on example.org"
type = "browser"
status = "paused"
message = "Notify @qa"
device_ids = ["laptop_large"]
locations = ["aws:eu-central-1"]
tags = []
request_definition {
method = "GET"
url = "https://app.datadoghq.com"
}
browser_step {
name = "Check current url"
type = "assertCurrentUrl"
params {
check = "contains"
value = "datadoghq"
}
}
browser_step {
name = "Test a downloaded file"
type = "assertFileDownload"
params {
file = jsonencode(
{
md5 = "abcdef1234567890" // MD5 hash of the file
sizeCheck = {
type = "equals" // "equals", "greater", "greaterEquals", "lower",
// "lowerEquals", "notEquals", "between"
value = 1
// min = 1 // only used for "between"
// max = 1 // only used for "between"
}
nameCheck = {
type = "contains" // "contains", "equals", "isEmpty", "matchRegex",
// "notContains", "notIsEmpty", "notEquals",
// "notStartsWith", "startsWith"
value = ".xls"
}
}
)
}
}
browser_variable {
type = "text"
name = "MY_PATTERN_VAR"
pattern = "{{numeric(3)}}"
example = "597"
}
browser_variable {
type = "email"
name = "MY_EMAIL_VAR"
pattern = "jd8-afe-ydv.{{ numeric(10) }}@synthetics.dtdg.co"
example = "jd8-afe-ydv.4546132139@synthetics.dtdg.co"
}
browser_variable {
type = "global"
name = "MY_GLOBAL_VAR"
id = "76636cd1-82e2-4aeb-9cfe-51366a8198a2"
}
options_list {
tick_every = 3600
}
}
# Example Usage (GRPC API test)
# Create a new Datadog GRPC API test starting on google.org:50050
resource "datadog_synthetics_test" "grpc" {
type = "api"
subtype = "grpc"
request_definition {
method = "GET"
host = "google.com"
port = 50050
service = "Hello"
plain_proto_file = <<EOT
syntax = "proto3";
option java_multiple_files = true;
option java_package = "io.grpc.examples.helloworld";
option java_outer_classname = "HelloWorldProto";
option objc_class_prefix = "HLW";
package helloworld;
// The greeting service definition.
service Greeter {
// Sends a greeting
rpc SayHello (HelloRequest) returns (HelloReply) {}
}
// The request message containing the user's name.
message HelloRequest {
string name = 1;
}
// The response message containing the greetings
message HelloReply {
string message = 1;
}
EOT
}
request_metadata = {
header = "value"
}
assertion {
type = "responseTime"
operator = "lessThan"
target = "2000"
}
assertion {
operator = "is"
type = "grpcHealthcheckStatus"
target = 1
}
assertion {
operator = "is"
target = "proto target"
type = "grpcProto"
}
assertion {
operator = "is"
target = "123"
property = "property"
type = "grpcMetadata"
}
locations = ["aws:eu-central-1"]
options_list {
tick_every = 60
}
name = "GRPC API test"
message = "Notify @datadog.user"
tags = ["foo:bar", "baz"]
status = "paused"
}
locations
(Set of String) Array of locations used to run the test. Refer to the Datadog Synthetics location data source to retrieve the list of locations.name
(String) Name of Datadog synthetics test.status
(String) Define whether you want to start (live
) or pause (paused
) a Synthetic test. Valid values are live
, paused
.type
(String) Synthetics test type. Valid values are api
, browser
.api_step
(Block List) Steps for multistep api tests (see below for nested schema)assertion
(Block List) Assertions used for the test. Multiple assertion
blocks are allowed with the structure below. (see below for nested schema)browser_step
(Block List) Steps for browser tests. (see below for nested schema)browser_variable
(Block List) Variables used for a browser test steps. Multiple variable
blocks are allowed with the structure below. (see below for nested schema)config_variable
(Block List) Variables used for the test configuration. Multiple config_variable
blocks are allowed with the structure below. (see below for nested schema)device_ids
(List of String) Required if type = "browser"
. Array with the different device IDs used to run the test. Valid values are laptop_large
, tablet
, mobile_small
, chrome.laptop_large
, chrome.tablet
, chrome.mobile_small
, firefox.laptop_large
, firefox.tablet
, firefox.mobile_small
, edge.laptop_large
, edge.tablet
, edge.mobile_small
.message
(String) A message to include with notifications for this synthetics test. Email notifications can be sent to specific users by using the same @username
notation as events. Defaults to ""
.options_list
(Block List, Max: 1) (see below for nested schema)request_basicauth
(Block List, Max: 1) The HTTP basic authentication credentials. Exactly one nested block is allowed with the structure below. (see below for nested schema)request_client_certificate
(Block List, Max: 1) Client certificate to use when performing the test request. Exactly one nested block is allowed with the structure below. (see below for nested schema)request_definition
(Block List, Max: 1) Required if type = "api"
. The synthetics test request. (see below for nested schema)request_headers
(Map of String) Header name and value map.request_metadata
(Map of String) Metadata to include when performing the gRPC test.request_proxy
(Block List, Max: 1) The proxy to perform the test. (see below for nested schema)request_query
(Map of String) Query arguments name and value map.set_cookie
(String) Cookies to be used for a browser test request, using the Set-Cookie syntax.subtype
(String) The subtype of the Synthetic API test. Defaults to http
. Valid values are http
, ssl
, tcp
, dns
, multi
, icmp
, udp
, websocket
, grpc
.tags
(List of String) A list of tags to associate with your synthetics test. This can help you categorize and filter tests in the manage synthetics page of the UI. Default is an empty list ([]
).id
(String) The ID of this resource.monitor_id
(Number) ID of the monitor associated with the Datadog synthetics test.api_step
Required:
name
(String) The name of the step.Optional:
allow_failure
(Boolean) Determines whether or not to continue with test if this step fails.assertion
(Block List) Assertions used for the test. Multiple assertion
blocks are allowed with the structure below. (see below for nested schema)extracted_value
(Block List) Values to parse and save as variables from the response. (see below for nested schema)is_critical
(Boolean) Determines whether or not to consider the entire test as failed if this step fails. Can be used only if allow_failure
is true
.request_basicauth
(Block List, Max: 1) The HTTP basic authentication credentials. Exactly one nested block is allowed with the structure below. (see below for nested schema)request_client_certificate
(Block List, Max: 1) Client certificate to use when performing the test request. Exactly one nested block is allowed with the structure below. (see below for nested schema)request_definition
(Block List, Max: 1) The request for the api step. (see below for nested schema)request_headers
(Map of String) Header name and value map.request_proxy
(Block List, Max: 1) The proxy to perform the test. (see below for nested schema)request_query
(Map of String) Query arguments name and value map.retry
(Block List, Max: 1) (see below for nested schema)subtype
(String) The subtype of the Synthetic multistep API test step. Valid values are http
, grpc
. Defaults to "http"
.api_step.assertion
Required:
operator
(String) Assertion operator. Note Only some combinations of type
and operator
are valid (please refer to Datadog documentation).type
(String) Type of assertion. Note Only some combinations of type
and operator
are valid (please refer to Datadog documentation). Valid values are body
, header
, statusCode
, certificate
, responseTime
, property
, recordEvery
, recordSome
, tlsVersion
, minTlsVersion
, latency
, packetLossPercentage
, packetsReceived
, networkHop
, receivedMessage
, grpcHealthcheckStatus
, grpcMetadata
, grpcProto
, connection
.Optional:
property
(String) If assertion type is header
, this is the header name.target
(String) Expected value. Depends on the assertion type, refer to Datadog documentation for details.targetjsonpath
(Block List, Max: 1) Expected structure if operator
is validatesJSONPath
. Exactly one nested block is allowed with the structure below. (see below for nested schema)targetxpath
(Block List, Max: 1) Expected structure if operator
is validatesXPath
. Exactly one nested block is allowed with the structure below. (see below for nested schema)timings_scope
(String) Timings scope for response time assertions. Valid values are all
, withoutDNS
.api_step.assertion.targetjsonpath
Required:
jsonpath
(String) The JSON path to assert.operator
(String) The specific operator to use on the path.Optional:
targetvalue
(String) Expected matching value.api_step.assertion.targetxpath
Required:
operator
(String) The specific operator to use on the path.xpath
(String) The xpath to assert.Optional:
targetvalue
(String) Expected matching value.api_step.extracted_value
Required:
name
(String)parser
(Block List, Min: 1, Max: 1) (see below for nested schema)type
(String) Property of the Synthetics Test Response to use for the variable. Valid values are http_body
, http_header
, local_variable
.Optional:
field
(String) When type is http_header
, name of the header to use to extract the value.secure
(Boolean) Determines whether or not the extracted value will be obfuscated.api_step.extracted_value.parser
Required:
type
(String) Type of parser for a Synthetics global variable from a synthetics test. Valid values are raw
, json_path
, regex
, x_path
.Optional:
value
(String) Regex or JSON path used for the parser. Not used with type raw
.api_step.request_basicauth
Optional:
access_key
(String, Sensitive) Access key for SIGV4
authentication.access_token_url
(String) Access token url for oauth-client
or oauth-rop
authentication.audience
(String) Audience for oauth-client
or oauth-rop
authentication. Defaults to ""
.client_id
(String) Client ID for oauth-client
or oauth-rop
authentication.client_secret
(String, Sensitive) Client secret for oauth-client
or oauth-rop
authentication.domain
(String) Domain for ntlm
authentication.password
(String, Sensitive) Password for authentication.region
(String) Region for SIGV4
authentication.resource
(String) Resource for oauth-client
or oauth-rop
authentication. Defaults to ""
.scope
(String) Scope for oauth-client
or oauth-rop
authentication. Defaults to ""
.secret_key
(String, Sensitive) Secret key for SIGV4
authentication.service_name
(String) Service name for SIGV4
authentication.session_token
(String) Session token for SIGV4
authentication.token_api_authentication
(String) Token API Authentication for oauth-client
or oauth-rop
authentication. Valid values are header
, body
.type
(String) Type of basic authentication to use when performing the test. Defaults to "web"
.username
(String) Username for authentication.workstation
(String) Workstation for ntlm
authentication.api_step.request_client_certificate
Required:
cert
(Block List, Min: 1, Max: 1) (see below for nested schema)key
(Block List, Min: 1, Max: 1) (see below for nested schema)api_step.request_client_certificate.cert
Required:
content
(String, Sensitive) Content of the certificate.Optional:
filename
(String) File name for the certificate. Defaults to "Provided in Terraform config"
.api_step.request_client_certificate.key
Required:
content
(String, Sensitive) Content of the certificate.Optional:
filename
(String) File name for the certificate. Defaults to "Provided in Terraform config"
.api_step.request_definition
Optional:
allow_insecure
(Boolean) Allows loading insecure content for an HTTP request in an API test or in a multistep API test step.body
(String) The request body.body_type
(String) Type of the request body. Valid values are text/plain
, application/json
, text/xml
, text/html
, application/x-www-form-urlencoded
, graphql
, application/octet-stream
, multipart/form-data
.call_type
(String) The type of gRPC call to perform. Valid values are healthcheck
, unary
.certificate_domains
(List of String) By default, the client certificate is applied on the domain of the starting URL for browser tests. If you want your client certificate to be applied on other domains instead, add them in certificate_domains
.dns_server
(String) DNS server to use for DNS tests (subtype = "dns"
).dns_server_port
(Number) DNS server port to use for DNS tests.follow_redirects
(Boolean) Determines whether or not the API HTTP test should follow redirects.host
(String) Host name to perform the test with.http_version
(String) HTTP version to use for an HTTP request in an API test or step. Valid values are http1
, http2
, any
.message
(String) For UDP and websocket tests, message to send with the request.method
(String) Either the HTTP method/verb to use or a gRPC method available on the service set in the service
field. Required if subtype
is HTTP
or if subtype
is grpc
and callType
is unary
.no_saving_response_body
(Boolean) Determines whether or not to save the response body.number_of_packets
(Number) Number of pings to use per test for ICMP tests (subtype = "icmp"
) between 0 and 10.persist_cookies
(Boolean) Persist cookies across redirects.plain_proto_file
(String) The content of a proto file as a string.port
(Number) Port to use when performing the test.proto_json_descriptor
(String, Deprecated) A protobuf JSON descriptor. Deprecated. Use plain_proto_file
instead.servername
(String) For SSL tests, it specifies on which server you want to initiate the TLS handshake, allowing the server to present one of multiple possible certificates on the same IP address and TCP port number.service
(String) The gRPC service on which you want to perform the gRPC call.should_track_hops
(Boolean) This will turn on a traceroute probe to discover all gateways along the path to the host destination. For ICMP tests (subtype = "icmp"
).timeout
(Number) Timeout in seconds for the test. Defaults to 60
.url
(String) The URL to send the request to.api_step.request_proxy
Required:
url
(String) URL of the proxy to perform the test.Optional:
headers
(Map of String) Header name and value map.api_step.retry
Optional:
count
(Number) Number of retries needed to consider a location as failed before sending a notification alert. Defaults to 0
.interval
(Number) Interval between a failed test and the next retry in milliseconds. Defaults to 300
.assertion
Required:
operator
(String) Assertion operator. Note Only some combinations of type
and operator
are valid (please refer to Datadog documentation).type
(String) Type of assertion. Note Only some combinations of type
and operator
are valid (please refer to Datadog documentation). Valid values are body
, header
, statusCode
, certificate
, responseTime
, property
, recordEvery
, recordSome
, tlsVersion
, minTlsVersion
, latency
, packetLossPercentage
, packetsReceived
, networkHop
, receivedMessage
, grpcHealthcheckStatus
, grpcMetadata
, grpcProto
, connection
.Optional:
property
(String) If assertion type is header
, this is the header name.target
(String) Expected value. Depends on the assertion type, refer to Datadog documentation for details.targetjsonpath
(Block List, Max: 1) Expected structure if operator
is validatesJSONPath
. Exactly one nested block is allowed with the structure below. (see below for nested schema)targetxpath
(Block List, Max: 1) Expected structure if operator
is validatesXPath
. Exactly one nested block is allowed with the structure below. (see below for nested schema)timings_scope
(String) Timings scope for response time assertions. Valid values are all
, withoutDNS
.assertion.targetjsonpath
Required:
jsonpath
(String) The JSON path to assert.operator
(String) The specific operator to use on the path.Optional:
targetvalue
(String) Expected matching value.assertion.targetxpath
Required:
operator
(String) The specific operator to use on the path.xpath
(String) The xpath to assert.Optional:
targetvalue
(String) Expected matching value.browser_step
Required:
name
(String) Name of the step.params
(Block List, Min: 1, Max: 1) Parameters for the step. (see below for nested schema)type
(String) Type of the step. Valid values are assertCurrentUrl
, assertElementAttribute
, assertElementContent
, assertElementPresent
, assertEmail
, assertFileDownload
, assertFromJavascript
, assertPageContains
, assertPageLacks
, click
, extractFromJavascript
, extractVariable
, goToEmailLink
, goToUrl
, goToUrlAndMeasureTti
, hover
, playSubTest
, pressKey
, refresh
, runApiTest
, scroll
, selectOption
, typeText
, uploadFiles
, wait
.Optional:
allow_failure
(Boolean) Determines if the step should be allowed to fail.force_element_update
(Boolean) Force update of the "element" parameter for the stepis_critical
(Boolean) Determines whether or not to consider the entire test as failed if this step fails. Can be used only if allow_failure
is true
.no_screenshot
(Boolean) Prevents saving screenshots of the step.timeout
(Number) Used to override the default timeout of a step.browser_step.params
Optional:
attribute
(String) Name of the attribute to use for an "assert attribute" step.check
(String) Check type to use for an assertion step. Valid values are equals
, notEquals
, contains
, notContains
, startsWith
, notStartsWith
, greater
, lower
, greaterEquals
, lowerEquals
, matchRegex
, between
, isEmpty
, notIsEmpty
.click_type
(String) Type of click to use for a "click" step.code
(String) Javascript code to use for the step.delay
(Number) Delay between each key stroke for a "type test" step.element
(String) Element to use for the step, json encoded string.element_user_locator
(Block List, Max: 1) Custom user selector to use for the step. (see below for nested schema)email
(String) Details of the email for an "assert email" step.file
(String) JSON encoded string used for an "assert download" step. Refer to the examples for a usage example showing the schema.files
(String) Details of the files for an "upload files" step, json encoded string.modifiers
(List of String) Modifier to use for a "press key" step.playing_tab_id
(String) ID of the tab to play the subtest.request
(String) Request for an API step.subtest_public_id
(String) ID of the Synthetics test to use as subtest.value
(String) Value of the step.variable
(Block List, Max: 1) Details of the variable to extract. (see below for nested schema)with_click
(Boolean) For "file upload" steps.x
(Number) X coordinates for a "scroll step".y
(Number) Y coordinates for a "scroll step".browser_step.params.element_user_locator
Required:
value
(Block List, Min: 1, Max: 1) (see below for nested schema)Optional:
fail_test_on_cannot_locate
(Boolean) Defaults to false
.browser_step.params.element_user_locator.value
Required:
value
(String)Optional:
type
(String) Defaults to "css"
.browser_step.params.variable
Optional:
example
(String) Example of the extracted variable. Defaults to ""
.name
(String) Name of the extracted variable.browser_variable
Required:
name
(String) Name of the variable.type
(String) Type of browser test variable. Valid values are element
, email
, global
, javascript
, text
.Optional:
example
(String) Example for the variable. Defaults to ""
.id
(String) ID of the global variable to use. This is actually only used (and required) in the case of using a variable of type global
.pattern
(String) Pattern of the variable. Defaults to ""
.secure
(Boolean) Determines whether or not the browser test variable is obfuscated. Can only be used with a browser variable of type text
config_variable
Required:
name
(String) Name of the variable.type
(String) Type of test configuration variable. Valid values are global
, text
.Optional:
example
(String) Example for the variable. This value is not returned by the api when secure = true
. Avoid drift by only making updates to this value from within Terraform.id
(String) When type = global
, ID of the global variable to use.pattern
(String) Pattern of the variable. This value is not returned by the api when secure = true
. Avoid drift by only making updates to this value from within Terraform.secure
(Boolean) Whether the value of this variable will be obfuscated in test results. Defaults to false
.options_list
Required:
tick_every
(Number) How often the test should run (in seconds).Optional:
accept_self_signed
(Boolean) For SSL test, whether or not the test should allow self signed certificates.allow_insecure
(Boolean) Allows loading insecure content for an HTTP request in an API test or in a multistep API test step.check_certificate_revocation
(Boolean) For SSL test, whether or not the test should fail on revoked certificate in stapled OCSP.ci
(Block List, Max: 1) CI/CD options for a Synthetic test. (see below for nested schema)disable_cors
(Boolean) Disable Cross-Origin Resource Sharing for browser tests.disable_csp
(Boolean) Disable Content Security Policy for browser tests.follow_redirects
(Boolean) Determines whether or not the API HTTP test should follow redirects.http_version
(String) HTTP version to use for an HTTP request in an API test or step. Valid values are http1
, http2
, any
.ignore_server_certificate_error
(Boolean) Ignore server certificate error for browser tests.initial_navigation_timeout
(Number) Timeout before declaring the initial step as failed (in seconds) for browser tests.min_failure_duration
(Number) Minimum amount of time in failure required to trigger an alert (in seconds). Default is 0
.min_location_failed
(Number) Minimum number of locations in failure required to trigger an alert. Defaults to 1
.monitor_name
(String) The monitor name is used for the alert title as well as for all monitor dashboard widgets and SLOs.monitor_options
(Block List, Max: 1) (see below for nested schema)monitor_priority
(Number)no_screenshot
(Boolean) Prevents saving screenshots of the steps.restricted_roles
(Set of String) A list of role identifiers pulled from the Roles API to restrict read and write access.retry
(Block List, Max: 1) (see below for nested schema)rum_settings
(Block List, Max: 1) The RUM data collection settings for the Synthetic browser test. (see below for nested schema)scheduling
(Block List, Max: 1) Object containing timeframes and timezone used for advanced scheduling. (see below for nested schema)options_list.ci
Optional:
execution_rule
(String) Execution rule for a Synthetics test. Valid values are blocking
, non_blocking
, skipped
.options_list.monitor_options
Optional:
renotify_interval
(Number) Specify a renotification frequency in minutes. Values available by default are 0
, 10
, 20
, 30
, 40
, 50
, 60
, 90
, 120
, 180
, 240
, 300
, 360
, 720
, 1440
. Defaults to 0
.options_list.retry
Optional:
count
(Number) Number of retries needed to consider a location as failed before sending a notification alert. Defaults to 0
.interval
(Number) Interval between a failed test and the next retry in milliseconds. Defaults to 300
.options_list.rum_settings
Required:
is_enabled
(Boolean) Determines whether RUM data is collected during test runs.Optional:
application_id
(String) RUM application ID used to collect RUM data for the browser test.client_token_id
(Number, Sensitive) RUM application API key ID used to collect RUM data for the browser test.options_list.scheduling
Required:
timeframes
(Block Set, Min: 1) Array containing objects describing the scheduling pattern to apply to each day. (see below for nested schema)timezone
(String) Timezone in which the timeframe is based.options_list.scheduling.timeframes
Required:
day
(Number) Number representing the day of the weekfrom
(String) The hour of the day on which scheduling starts.to
(String) The hour of the day on which scheduling ends.request_basicauth
Optional:
access_key
(String, Sensitive) Access key for SIGV4
authentication.access_token_url
(String) Access token url for oauth-client
or oauth-rop
authentication.audience
(String) Audience for oauth-client
or oauth-rop
authentication. Defaults to ""
.client_id
(String) Client ID for oauth-client
or oauth-rop
authentication.client_secret
(String, Sensitive) Client secret for oauth-client
or oauth-rop
authentication.domain
(String) Domain for ntlm
authentication.password
(String, Sensitive) Password for authentication.region
(String) Region for SIGV4
authentication.resource
(String) Resource for oauth-client
or oauth-rop
authentication. Defaults to ""
.scope
(String) Scope for oauth-client
or oauth-rop
authentication. Defaults to ""
.secret_key
(String, Sensitive) Secret key for SIGV4
authentication.service_name
(String) Service name for SIGV4
authentication.session_token
(String) Session token for SIGV4
authentication.token_api_authentication
(String) Token API Authentication for oauth-client
or oauth-rop
authentication. Valid values are header
, body
.type
(String) Type of basic authentication to use when performing the test. Defaults to "web"
.username
(String) Username for authentication.workstation
(String) Workstation for ntlm
authentication.request_client_certificate
Required:
cert
(Block List, Min: 1, Max: 1) (see below for nested schema)key
(Block List, Min: 1, Max: 1) (see below for nested schema)request_client_certificate.cert
Required:
content
(String, Sensitive) Content of the certificate.Optional:
filename
(String) File name for the certificate. Defaults to "Provided in Terraform config"
.request_client_certificate.key
Required:
content
(String, Sensitive) Content of the certificate.Optional:
filename
(String) File name for the certificate. Defaults to "Provided in Terraform config"
.request_definition
Optional:
body
(String) The request body.body_type
(String) Type of the request body. Valid values are text/plain
, application/json
, text/xml
, text/html
, application/x-www-form-urlencoded
, graphql
, application/octet-stream
, multipart/form-data
.call_type
(String) The type of gRPC call to perform. Valid values are healthcheck
, unary
.certificate_domains
(List of String) By default, the client certificate is applied on the domain of the starting URL for browser tests. If you want your client certificate to be applied on other domains instead, add them in certificate_domains
.dns_server
(String) DNS server to use for DNS tests (subtype = "dns"
).dns_server_port
(Number) DNS server port to use for DNS tests.host
(String) Host name to perform the test with.http_version
(String) HTTP version to use for an HTTP request in an API test or step. Valid values are http1
, http2
, any
.message
(String) For UDP and websocket tests, message to send with the request.method
(String) Either the HTTP method/verb to use or a gRPC method available on the service set in the service
field. Required if subtype
is HTTP
or if subtype
is grpc
and callType
is unary
.no_saving_response_body
(Boolean) Determines whether or not to save the response body.number_of_packets
(Number) Number of pings to use per test for ICMP tests (subtype = "icmp"
) between 0 and 10.persist_cookies
(Boolean) Persist cookies across redirects.plain_proto_file
(String) The content of a proto file as a string.port
(Number) Port to use when performing the test.proto_json_descriptor
(String, Deprecated) A protobuf JSON descriptor. Deprecated. Use plain_proto_file
instead.servername
(String) For SSL tests, it specifies on which server you want to initiate the TLS handshake, allowing the server to present one of multiple possible certificates on the same IP address and TCP port number.service
(String) The gRPC service on which you want to perform the gRPC call.should_track_hops
(Boolean) This will turn on a traceroute probe to discover all gateways along the path to the host destination. For ICMP tests (subtype = "icmp"
).timeout
(Number) Timeout in seconds for the test. Defaults to 60
.url
(String) The URL to send the request to.request_proxy
Required:
url
(String) URL of the proxy to perform the test.Optional:
headers
(Map of String) Header name and value map.Import is supported using the following syntax:
# Synthetics tests can be imported using their public string ID, e.g.
terraform import datadog_synthetics_test.fizz abc-123-xyz