SyntheticsTest
Provides a Datadog synthetics test resource. This can be used to create and manage Datadog synthetics test.
Synthetics Browser test
Support for Synthetics Browser test is limited when creating steps. Some steps types (like steps involving elements) cannot be created, but they can be imported.
Assertion format
The resource was changed to have assertions be a list of assertion
blocks instead of single assertions
array, to support the JSON path operations. We’ll remove assertions
support in the future: to migrate, rename your attribute to assertion
and turn array elements into independent blocks. For example:
import * as pulumi from "@pulumi/pulumi";
import * as datadog from "@pulumi/datadog";
const testApi = new datadog.SyntheticsTest("test_api", {
assertions: [
{
operator: "is",
target: "200",
type: "statusCode",
},
{
operator: "lessThan",
target: "1000",
type: "responseTime",
},
],
});
import pulumi
import pulumi_datadog as datadog
test_api = datadog.SyntheticsTest("testApi", assertions=[
{
"operator": "is",
"target": "200",
"type": "statusCode",
},
{
"operator": "lessThan",
"target": "1000",
"type": "responseTime",
},
])
using Pulumi;
using Datadog = Pulumi.Datadog;
class MyStack : Stack
{
public MyStack()
{
var testApi = new Datadog.SyntheticsTest("testApi", new Datadog.SyntheticsTestArgs
{
Assertions =
{
{
{ "operator", "is" },
{ "target", "200" },
{ "type", "statusCode" },
},
{
{ "operator", "lessThan" },
{ "target", "1000" },
{ "type", "responseTime" },
},
},
});
}
}
package main
import (
"github.com/pulumi/pulumi-datadog/sdk/v2/go/datadog"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := datadog.NewSyntheticsTest(ctx, "testApi", &datadog.SyntheticsTestArgs{
Assertions: pulumi.StringMapArray{
pulumi.StringMap{
"operator": pulumi.String("is"),
"target": pulumi.String("200"),
"type": pulumi.String("statusCode"),
},
pulumi.StringMap{
"operator": pulumi.String("lessThan"),
"target": pulumi.String("1000"),
"type": pulumi.String("responseTime"),
},
},
})
if err != nil {
return err
}
return nil
})
}
turns into:
import * as pulumi from "@pulumi/pulumi";
import * as datadog from "@pulumi/datadog";
const testApi = new datadog.SyntheticsTest("test_api", {
assertions: [
{
operator: "is",
target: "200",
type: "statusCode",
},
{
operator: "lessThan",
target: "1000",
type: "responseTime",
},
],
});
import pulumi
import pulumi_datadog as datadog
test_api = datadog.SyntheticsTest("testApi", assertions=[
{
"operator": "is",
"target": "200",
"type": "statusCode",
},
{
"operator": "lessThan",
"target": "1000",
"type": "responseTime",
},
])
using Pulumi;
using Datadog = Pulumi.Datadog;
class MyStack : Stack
{
public MyStack()
{
var testApi = new Datadog.SyntheticsTest("testApi", new Datadog.SyntheticsTestArgs
{
Assertions =
{
{
{ "operator", "is" },
{ "target", "200" },
{ "type", "statusCode" },
},
{
{ "operator", "lessThan" },
{ "target", "1000" },
{ "type", "responseTime" },
},
},
});
}
}
package main
import (
"github.com/pulumi/pulumi-datadog/sdk/v2/go/datadog"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := datadog.NewSyntheticsTest(ctx, "testApi", &datadog.SyntheticsTestArgs{
Assertions: pulumi.StringMapArray{
pulumi.StringMap{
"operator": pulumi.String("is"),
"target": pulumi.String("200"),
"type": pulumi.String("statusCode"),
},
pulumi.StringMap{
"operator": pulumi.String("lessThan"),
"target": pulumi.String("1000"),
"type": pulumi.String("responseTime"),
},
},
})
if err != nil {
return err
}
return nil
})
}
Example Usage
Synthetics API Test)
using Pulumi;
using Datadog = Pulumi.Datadog;
class MyStack : Stack
{
public MyStack()
{
var testApi = new Datadog.SyntheticsTest("testApi", new Datadog.SyntheticsTestArgs
{
Assertions =
{
{
{ "operator", "is" },
{ "target", "200" },
{ "type", "statusCode" },
},
},
Locations =
{
"aws:eu-central-1",
},
Message = "Notify @pagerduty",
Name = "An API test on example.org",
OptionsList = new Datadog.Inputs.SyntheticsTestOptionsListArgs
{
MonitorOptions = new Datadog.Inputs.SyntheticsTestOptionsListMonitorOptionsArgs
{
RenotifyInterval = 100,
},
Retry = new Datadog.Inputs.SyntheticsTestOptionsListRetryArgs
{
Count = 2,
Interval = 300,
},
TickEvery = 900,
},
Request = new Datadog.Inputs.SyntheticsTestRequestArgs
{
Method = "GET",
Url = "https://www.example.org",
},
RequestHeaders =
{
{ "Authentication", "Token: 1234566789" },
{ "Content-Type", "application/json" },
},
Status = "live",
Subtype = "http",
Tags =
{
"foo:bar",
"foo",
"env:test",
},
Type = "api",
});
}
}
package main
import (
"github.com/pulumi/pulumi-datadog/sdk/v2/go/datadog"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := datadog.NewSyntheticsTest(ctx, "testApi", &datadog.SyntheticsTestArgs{
Assertions: pulumi.StringMapArray{
pulumi.StringMap{
"operator": pulumi.String("is"),
"target": pulumi.String("200"),
"type": pulumi.String("statusCode"),
},
},
Locations: pulumi.StringArray{
pulumi.String("aws:eu-central-1"),
},
Message: pulumi.String("Notify @pagerduty"),
Name: pulumi.String("An API test on example.org"),
OptionsList: &datadog.SyntheticsTestOptionsListArgs{
MonitorOptions: &datadog.SyntheticsTestOptionsListMonitorOptionsArgs{
RenotifyInterval: pulumi.Int(100),
},
Retry: &datadog.SyntheticsTestOptionsListRetryArgs{
Count: pulumi.Int(2),
Interval: pulumi.Int(300),
},
TickEvery: pulumi.Int(900),
},
Request: &datadog.SyntheticsTestRequestArgs{
Method: pulumi.String("GET"),
Url: pulumi.String("https://www.example.org"),
},
RequestHeaders: pulumi.StringMap{
"Authentication": pulumi.String("Token: 1234566789"),
"Content-Type": pulumi.String("application/json"),
},
Status: pulumi.String("live"),
Subtype: pulumi.String("http"),
Tags: pulumi.StringArray{
pulumi.String("foo:bar"),
pulumi.String("foo"),
pulumi.String("env:test"),
},
Type: pulumi.String("api"),
})
if err != nil {
return err
}
return nil
})
}
import pulumi
import pulumi_datadog as datadog
test_api = datadog.SyntheticsTest("testApi",
assertions=[{
"operator": "is",
"target": "200",
"type": "statusCode",
}],
locations=["aws:eu-central-1"],
message="Notify @pagerduty",
name="An API test on example.org",
options_list=datadog.SyntheticsTestOptionsListArgs(
monitor_options=datadog.SyntheticsTestOptionsListMonitorOptionsArgs(
renotify_interval=100,
),
retry=datadog.SyntheticsTestOptionsListRetryArgs(
count=2,
interval=300,
),
tick_every=900,
),
request=datadog.SyntheticsTestRequestArgs(
method="GET",
url="https://www.example.org",
),
request_headers={
"Authentication": "Token: 1234566789",
"Content-Type": "application/json",
},
status="live",
subtype="http",
tags=[
"foo:bar",
"foo",
"env:test",
],
type="api")
import * as pulumi from "@pulumi/pulumi";
import * as datadog from "@pulumi/datadog";
const testApi = new datadog.SyntheticsTest("test_api", {
assertions: [{
operator: "is",
target: "200",
type: "statusCode",
}],
locations: ["aws:eu-central-1"],
message: "Notify @pagerduty",
name: "An API test on example.org",
optionsList: {
monitorOptions: {
renotifyInterval: 100,
},
retry: {
count: 2,
interval: 300,
},
tickEvery: 900,
},
request: {
method: "GET",
url: "https://www.example.org",
},
requestHeaders: {
Authentication: "Token: 1234566789",
"Content-Type": "application/json",
},
status: "live",
subtype: "http",
tags: [
"foo:bar",
"foo",
"env:test",
],
type: "api",
});
Synthetics SSL Test)
using Pulumi;
using Datadog = Pulumi.Datadog;
class MyStack : Stack
{
public MyStack()
{
var testSsl = new Datadog.SyntheticsTest("testSsl", new Datadog.SyntheticsTestArgs
{
Assertions =
{
{
{ "operator", "isInMoreThan" },
{ "target", 30 },
{ "type", "certificate" },
},
},
Locations =
{
"aws:eu-central-1",
},
Message = "Notify @pagerduty",
Name = "An API test on example.org",
OptionsList = new Datadog.Inputs.SyntheticsTestOptionsListArgs
{
AcceptSelfSigned = true,
TickEvery = 900,
},
Request = new Datadog.Inputs.SyntheticsTestRequestArgs
{
Host = "example.org",
Port = 443,
},
Status = "live",
Subtype = "ssl",
Tags =
{
"foo:bar",
"foo",
"env:test",
},
Type = "api",
});
}
}
package main
import (
"github.com/pulumi/pulumi-datadog/sdk/v2/go/datadog"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := datadog.NewSyntheticsTest(ctx, "testSsl", &datadog.SyntheticsTestArgs{
Assertions: pulumi.MapArray{
pulumi.Map{
"operator": pulumi.String("isInMoreThan"),
"target": pulumi.Float64(30),
"type": pulumi.String("certificate"),
},
},
Locations: pulumi.StringArray{
pulumi.String("aws:eu-central-1"),
},
Message: pulumi.String("Notify @pagerduty"),
Name: pulumi.String("An API test on example.org"),
OptionsList: &datadog.SyntheticsTestOptionsListArgs{
AcceptSelfSigned: pulumi.Bool(true),
TickEvery: pulumi.Int(900),
},
Request: &datadog.SyntheticsTestRequestArgs{
Host: pulumi.String("example.org"),
Port: pulumi.Int(443),
},
Status: pulumi.String("live"),
Subtype: pulumi.String("ssl"),
Tags: pulumi.StringArray{
pulumi.String("foo:bar"),
pulumi.String("foo"),
pulumi.String("env:test"),
},
Type: pulumi.String("api"),
})
if err != nil {
return err
}
return nil
})
}
import pulumi
import pulumi_datadog as datadog
test_ssl = datadog.SyntheticsTest("testSsl",
assertions=[{
"operator": "isInMoreThan",
"target": 30,
"type": "certificate",
}],
locations=["aws:eu-central-1"],
message="Notify @pagerduty",
name="An API test on example.org",
options_list=datadog.SyntheticsTestOptionsListArgs(
accept_self_signed=True,
tick_every=900,
),
request=datadog.SyntheticsTestRequestArgs(
host="example.org",
port=443,
),
status="live",
subtype="ssl",
tags=[
"foo:bar",
"foo",
"env:test",
],
type="api")
import * as pulumi from "@pulumi/pulumi";
import * as datadog from "@pulumi/datadog";
const testSsl = new datadog.SyntheticsTest("test_ssl", {
assertions: [{
operator: "isInMoreThan",
target: "30",
type: "certificate",
}],
locations: ["aws:eu-central-1"],
message: "Notify @pagerduty",
name: "An API test on example.org",
optionsList: {
acceptSelfSigned: true,
tickEvery: 900,
},
request: {
host: "example.org",
port: 443,
},
status: "live",
subtype: "ssl",
tags: [
"foo:bar",
"foo",
"env:test",
],
type: "api",
});
Synthetics TCP Test)
using Pulumi;
using Datadog = Pulumi.Datadog;
class MyStack : Stack
{
public MyStack()
{
var testTcp = new Datadog.SyntheticsTest("testTcp", new Datadog.SyntheticsTestArgs
{
Assertions =
{
{
{ "operator", "lessThan" },
{ "target", 2000 },
{ "type", "responseTime" },
},
},
Locations =
{
"aws:eu-central-1",
},
Message = "Notify @pagerduty",
Name = "An API test on example.org",
OptionsList = new Datadog.Inputs.SyntheticsTestOptionsListArgs
{
TickEvery = 900,
},
Request = new Datadog.Inputs.SyntheticsTestRequestArgs
{
Host = "example.org",
Port = 443,
},
Status = "live",
Subtype = "tcp",
Tags =
{
"foo:bar",
"foo",
"env:test",
},
Type = "api",
});
}
}
package main
import (
"github.com/pulumi/pulumi-datadog/sdk/v2/go/datadog"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := datadog.NewSyntheticsTest(ctx, "testTcp", &datadog.SyntheticsTestArgs{
Assertions: pulumi.MapArray{
pulumi.Map{
"operator": pulumi.String("lessThan"),
"target": pulumi.Float64(2000),
"type": pulumi.String("responseTime"),
},
},
Locations: pulumi.StringArray{
pulumi.String("aws:eu-central-1"),
},
Message: pulumi.String("Notify @pagerduty"),
Name: pulumi.String("An API test on example.org"),
OptionsList: &datadog.SyntheticsTestOptionsListArgs{
TickEvery: pulumi.Int(900),
},
Request: &datadog.SyntheticsTestRequestArgs{
Host: pulumi.String("example.org"),
Port: pulumi.Int(443),
},
Status: pulumi.String("live"),
Subtype: pulumi.String("tcp"),
Tags: pulumi.StringArray{
pulumi.String("foo:bar"),
pulumi.String("foo"),
pulumi.String("env:test"),
},
Type: pulumi.String("api"),
})
if err != nil {
return err
}
return nil
})
}
import pulumi
import pulumi_datadog as datadog
test_tcp = datadog.SyntheticsTest("testTcp",
assertions=[{
"operator": "lessThan",
"target": 2000,
"type": "responseTime",
}],
locations=["aws:eu-central-1"],
message="Notify @pagerduty",
name="An API test on example.org",
options_list=datadog.SyntheticsTestOptionsListArgs(
tick_every=900,
),
request=datadog.SyntheticsTestRequestArgs(
host="example.org",
port=443,
),
status="live",
subtype="tcp",
tags=[
"foo:bar",
"foo",
"env:test",
],
type="api")
import * as pulumi from "@pulumi/pulumi";
import * as datadog from "@pulumi/datadog";
const testTcp = new datadog.SyntheticsTest("test_tcp", {
assertions: [{
operator: "lessThan",
target: "2000",
type: "responseTime",
}],
locations: ["aws:eu-central-1"],
message: "Notify @pagerduty",
name: "An API test on example.org",
optionsList: {
tickEvery: 900,
},
request: {
host: "example.org",
port: 443,
},
status: "live",
subtype: "tcp",
tags: [
"foo:bar",
"foo",
"env:test",
],
type: "api",
});
Synthetics DNS Test)
using Pulumi;
using Datadog = Pulumi.Datadog;
class MyStack : Stack
{
public MyStack()
{
var testDns = new Datadog.SyntheticsTest("testDns", new Datadog.SyntheticsTestArgs
{
Assertions =
{
{
{ "operator", "is" },
{ "property", "A" },
{ "target", "0.0.0.0" },
{ "type", "recordSome" },
},
},
Locations =
{
"aws:eu-central-1",
},
Message = "Notify @pagerduty",
Name = "An API test on example.org",
OptionsList = new Datadog.Inputs.SyntheticsTestOptionsListArgs
{
TickEvery = 900,
},
Request = new Datadog.Inputs.SyntheticsTestRequestArgs
{
Host = "example.org",
},
Status = "live",
Subtype = "dns",
Tags =
{
"foo:bar",
"foo",
"env:test",
},
Type = "api",
});
}
}
package main
import (
"github.com/pulumi/pulumi-datadog/sdk/v2/go/datadog"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := datadog.NewSyntheticsTest(ctx, "testDns", &datadog.SyntheticsTestArgs{
Assertions: pulumi.StringMapArray{
pulumi.StringMap{
"operator": pulumi.String("is"),
"property": pulumi.String("A"),
"target": pulumi.String("0.0.0.0"),
"type": pulumi.String("recordSome"),
},
},
Locations: pulumi.StringArray{
pulumi.String("aws:eu-central-1"),
},
Message: pulumi.String("Notify @pagerduty"),
Name: pulumi.String("An API test on example.org"),
OptionsList: &datadog.SyntheticsTestOptionsListArgs{
TickEvery: pulumi.Int(900),
},
Request: &datadog.SyntheticsTestRequestArgs{
Host: pulumi.String("example.org"),
},
Status: pulumi.String("live"),
Subtype: pulumi.String("dns"),
Tags: pulumi.StringArray{
pulumi.String("foo:bar"),
pulumi.String("foo"),
pulumi.String("env:test"),
},
Type: pulumi.String("api"),
})
if err != nil {
return err
}
return nil
})
}
import pulumi
import pulumi_datadog as datadog
test_dns = datadog.SyntheticsTest("testDns",
assertions=[{
"operator": "is",
"property": "A",
"target": "0.0.0.0",
"type": "recordSome",
}],
locations=["aws:eu-central-1"],
message="Notify @pagerduty",
name="An API test on example.org",
options_list=datadog.SyntheticsTestOptionsListArgs(
tick_every=900,
),
request=datadog.SyntheticsTestRequestArgs(
host="example.org",
),
status="live",
subtype="dns",
tags=[
"foo:bar",
"foo",
"env:test",
],
type="api")
import * as pulumi from "@pulumi/pulumi";
import * as datadog from "@pulumi/datadog";
const testDns = new datadog.SyntheticsTest("test_dns", {
assertions: [{
operator: "is",
property: "A",
target: "0.0.0.0",
type: "recordSome",
}],
locations: ["aws:eu-central-1"],
message: "Notify @pagerduty",
name: "An API test on example.org",
optionsList: {
tickEvery: 900,
},
request: {
host: "example.org",
},
status: "live",
subtype: "dns",
tags: [
"foo:bar",
"foo",
"env:test",
],
type: "api",
});
Synthetics Browser Test)
using System.Collections.Generic;
using System.Text.Json;
using Pulumi;
using Datadog = Pulumi.Datadog;
class MyStack : Stack
{
public MyStack()
{
// Create a new Datadog Synthetics Browser test starting on https://www.example.org
var testBrowser = new Datadog.SyntheticsTest("testBrowser", new Datadog.SyntheticsTestArgs
{
Type = "browser",
Request = new Datadog.Inputs.SyntheticsTestRequestArgs
{
Method = "GET",
Url = "https://app.datadoghq.com",
},
DeviceIds =
{
"laptop_large",
},
Locations =
{
"aws:eu-central-1",
},
OptionsList = new Datadog.Inputs.SyntheticsTestOptionsListArgs
{
TickEvery = 3600,
},
Name = "A Browser test on example.org",
Message = "Notify @qa",
Tags = {},
Status = "paused",
Steps =
{
new Datadog.Inputs.SyntheticsTestStepArgs
{
Name = "Check current url",
Type = "assertCurrentUrl",
Params = JsonSerializer.Serialize(new Dictionary<string, object?>
{
{ "check", "contains" },
{ "value", "datadoghq" },
}),
},
},
BrowserVariables =
{
new Datadog.Inputs.SyntheticsTestBrowserVariableArgs
{
Type = "text",
Name = "MY_PATTERN_VAR",
Pattern = "{{numeric(3)}}",
Example = "597",
},
new Datadog.Inputs.SyntheticsTestBrowserVariableArgs
{
Type = "email",
Name = "MY_EMAIL_VAR",
Pattern = "jd8-afe-ydv.{{ numeric(10) }}@synthetics.dtdg.co",
Example = "jd8-afe-ydv.4546132139@synthetics.dtdg.co",
},
new Datadog.Inputs.SyntheticsTestBrowserVariableArgs
{
Type = "global",
Name = "MY_GLOBAL_VAR",
Id = "76636cd1-82e2-4aeb-9cfe-51366a8198a2",
},
},
});
}
}
Coming soon!
import pulumi
import json
import pulumi_datadog as datadog
# Create a new Datadog Synthetics Browser test starting on https://www.example.org
test_browser = datadog.SyntheticsTest("testBrowser",
type="browser",
request=datadog.SyntheticsTestRequestArgs(
method="GET",
url="https://app.datadoghq.com",
),
device_ids=["laptop_large"],
locations=["aws:eu-central-1"],
options_list=datadog.SyntheticsTestOptionsListArgs(
tick_every=3600,
),
name="A Browser test on example.org",
message="Notify @qa",
tags=[],
status="paused",
steps=[datadog.SyntheticsTestStepArgs(
name="Check current url",
type="assertCurrentUrl",
params=json.dumps({
"check": "contains",
"value": "datadoghq",
}),
)],
browser_variables=[
datadog.SyntheticsTestBrowserVariableArgs(
type="text",
name="MY_PATTERN_VAR",
pattern="{{numeric(3)}}",
example="597",
),
datadog.SyntheticsTestBrowserVariableArgs(
type="email",
name="MY_EMAIL_VAR",
pattern="jd8-afe-ydv.{{ numeric(10) }}@synthetics.dtdg.co",
example="jd8-afe-ydv.4546132139@synthetics.dtdg.co",
),
datadog.SyntheticsTestBrowserVariableArgs(
type="global",
name="MY_GLOBAL_VAR",
id="76636cd1-82e2-4aeb-9cfe-51366a8198a2",
),
])
import * as pulumi from "@pulumi/pulumi";
import * as datadog from "@pulumi/datadog";
// Create a new Datadog Synthetics Browser test starting on https://www.example.org
const testBrowser = new datadog.SyntheticsTest("testBrowser", {
type: "browser",
request: {
method: "GET",
url: "https://app.datadoghq.com",
},
deviceIds: ["laptop_large"],
locations: ["aws:eu-central-1"],
optionsList: {
tickEvery: 3600,
},
name: "A Browser test on example.org",
message: "Notify @qa",
tags: [],
status: "paused",
steps: [{
name: "Check current url",
type: "assertCurrentUrl",
params: JSON.stringify({
check: "contains",
value: "datadoghq",
}),
}],
browserVariables: [
{
type: "text",
name: "MY_PATTERN_VAR",
pattern: "{{numeric(3)}}",
example: "597",
},
{
type: "email",
name: "MY_EMAIL_VAR",
pattern: "jd8-afe-ydv.{{ numeric(10) }}@synthetics.dtdg.co",
example: "jd8-afe-ydv.4546132139@synthetics.dtdg.co",
},
{
type: "global",
name: "MY_GLOBAL_VAR",
id: "76636cd1-82e2-4aeb-9cfe-51366a8198a2",
},
],
});
Create a SyntheticsTest Resource
new SyntheticsTest(name: string, args: SyntheticsTestArgs, opts?: CustomResourceOptions);
def SyntheticsTest(resource_name: str, opts: Optional[ResourceOptions] = None, assertions: Optional[Sequence[Mapping[str, Any]]] = None, browser_variables: Optional[Sequence[SyntheticsTestBrowserVariableArgs]] = None, config_variables: Optional[Sequence[SyntheticsTestConfigVariableArgs]] = None, device_ids: Optional[Sequence[str]] = None, locations: Optional[Sequence[str]] = None, message: Optional[str] = None, name: Optional[str] = None, options: Optional[SyntheticsTestOptionsArgs] = None, options_list: Optional[SyntheticsTestOptionsListArgs] = None, request: Optional[SyntheticsTestRequestArgs] = None, request_basicauth: Optional[SyntheticsTestRequestBasicauthArgs] = None, request_client_certificate: Optional[SyntheticsTestRequestClientCertificateArgs] = None, request_headers: Optional[Mapping[str, Any]] = None, request_query: Optional[Mapping[str, Any]] = None, status: Optional[str] = None, steps: Optional[Sequence[SyntheticsTestStepArgs]] = None, subtype: Optional[str] = None, tags: Optional[Sequence[str]] = None, type: Optional[str] = None, variables: Optional[Sequence[SyntheticsTestVariableArgs]] = None)
func NewSyntheticsTest(ctx *Context, name string, args SyntheticsTestArgs, opts ...ResourceOption) (*SyntheticsTest, error)
public SyntheticsTest(string name, SyntheticsTestArgs args, CustomResourceOptions? opts = null)
- name string
- The unique name of the resource.
- args SyntheticsTestArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- opts ResourceOptions
- A bag of options that control this resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args SyntheticsTestArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args SyntheticsTestArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
SyntheticsTest Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.
Inputs
The SyntheticsTest resource accepts the following input properties:
- Locations List<string>
Array of locations used to run the test. Refer to Datadog documentation for available locations (e.g.
aws:eu-central-1
).- Name string
Name of Datadog synthetics test.
- Request
Synthetics
Test Request Args The synthetics test request. Required if
type = "api"
andsubtype = "http"
.- Status string
Define whether you want to start (
live
) or pause (paused
) a Synthetic test. Allowed enum values:live
,paused
- Type string
Synthetics test type (
api
orbrowser
).- Assertions
List<Immutable
Dictionary<string, object>> List of assertions.
- Browser
Variables List<SyntheticsTest Browser Variable Args> Variables used for a browser test steps. Multiple
variable
blocks are allowed with the structure below.- Config
Variables List<SyntheticsTest Config Variable Args> Variables used for the test configuration. Multiple
config_variable
blocks are allowed with the structure below.- Device
Ids List<string> Array with the different device IDs used to run the test. Allowed enum values:
laptop_large
,tablet
,mobile_small
(only available forbrowser
tests).- 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.- Options
Synthetics
Test Options Args - Options
List SyntheticsTest Options List Args - Request
Basicauth SyntheticsTest Request Basicauth Args The HTTP basic authentication credentials. Exactly one nested block is allowed with the structure below.
- Request
Client SyntheticsCertificate Test Request Client Certificate Args Client certificate to use when performing the test request. Exactly one nested block is allowed with the structure below.
- Request
Headers Dictionary<string, object> Header name and value map.
- Request
Query Dictionary<string, object> Query arguments name and value map.
- Steps
List<Synthetics
Test Step Args> Steps for browser tests.
- Subtype string
When
type
isapi
, choose fromhttp
,ssl
,tcp
ordns
. Defaults tohttp
.- List<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 (
[]
).- Variables
List<Synthetics
Test Variable Args> Variables used for a browser test steps. Multiple
browser_variable
blocks are allowed with the structure below.
- Locations []string
Array of locations used to run the test. Refer to Datadog documentation for available locations (e.g.
aws:eu-central-1
).- Name string
Name of Datadog synthetics test.
- Request
Synthetics
Test Request The synthetics test request. Required if
type = "api"
andsubtype = "http"
.- Status string
Define whether you want to start (
live
) or pause (paused
) a Synthetic test. Allowed enum values:live
,paused
- Type string
Synthetics test type (
api
orbrowser
).- Assertions []map[string]interface{}
List of assertions.
- Browser
Variables []SyntheticsTest Browser Variable Variables used for a browser test steps. Multiple
variable
blocks are allowed with the structure below.- Config
Variables []SyntheticsTest Config Variable Variables used for the test configuration. Multiple
config_variable
blocks are allowed with the structure below.- Device
Ids []string Array with the different device IDs used to run the test. Allowed enum values:
laptop_large
,tablet
,mobile_small
(only available forbrowser
tests).- 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.- Options
Synthetics
Test Options - Options
List SyntheticsTest Options List - Request
Basicauth SyntheticsTest Request Basicauth The HTTP basic authentication credentials. Exactly one nested block is allowed with the structure below.
- Request
Client SyntheticsCertificate Test Request Client Certificate Client certificate to use when performing the test request. Exactly one nested block is allowed with the structure below.
- Request
Headers map[string]interface{} Header name and value map.
- Request
Query map[string]interface{} Query arguments name and value map.
- Steps
[]Synthetics
Test Step Steps for browser tests.
- Subtype string
When
type
isapi
, choose fromhttp
,ssl
,tcp
ordns
. Defaults tohttp
.- []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 (
[]
).- Variables
[]Synthetics
Test Variable Variables used for a browser test steps. Multiple
browser_variable
blocks are allowed with the structure below.
- locations string[]
Array of locations used to run the test. Refer to Datadog documentation for available locations (e.g.
aws:eu-central-1
).- name string
Name of Datadog synthetics test.
- request
Synthetics
Test Request The synthetics test request. Required if
type = "api"
andsubtype = "http"
.- status string
Define whether you want to start (
live
) or pause (paused
) a Synthetic test. Allowed enum values:live
,paused
- type string
Synthetics test type (
api
orbrowser
).- assertions {[key: string]: any}[]
List of assertions.
- browser
Variables SyntheticsTest Browser Variable[] Variables used for a browser test steps. Multiple
variable
blocks are allowed with the structure below.- config
Variables SyntheticsTest Config Variable[] Variables used for the test configuration. Multiple
config_variable
blocks are allowed with the structure below.- device
Ids string[] Array with the different device IDs used to run the test. Allowed enum values:
laptop_large
,tablet
,mobile_small
(only available forbrowser
tests).- 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.- options
Synthetics
Test Options - options
List SyntheticsTest Options List - request
Basicauth SyntheticsTest Request Basicauth The HTTP basic authentication credentials. Exactly one nested block is allowed with the structure below.
- request
Client SyntheticsCertificate Test Request Client Certificate Client certificate to use when performing the test request. Exactly one nested block is allowed with the structure below.
- request
Headers {[key: string]: any} Header name and value map.
- request
Query {[key: string]: any} Query arguments name and value map.
- steps
Synthetics
Test Step[] Steps for browser tests.
- subtype string
When
type
isapi
, choose fromhttp
,ssl
,tcp
ordns
. Defaults tohttp
.- 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 (
[]
).- variables
Synthetics
Test Variable[] Variables used for a browser test steps. Multiple
browser_variable
blocks are allowed with the structure below.
- locations Sequence[str]
Array of locations used to run the test. Refer to Datadog documentation for available locations (e.g.
aws:eu-central-1
).- name str
Name of Datadog synthetics test.
- request
Synthetics
Test Request Args The synthetics test request. Required if
type = "api"
andsubtype = "http"
.- status str
Define whether you want to start (
live
) or pause (paused
) a Synthetic test. Allowed enum values:live
,paused
- type str
Synthetics test type (
api
orbrowser
).- assertions Sequence[Mapping[str, Any]]
List of assertions.
- browser_
variables Sequence[SyntheticsTest Browser Variable Args] Variables used for a browser test steps. Multiple
variable
blocks are allowed with the structure below.- config_
variables Sequence[SyntheticsTest Config Variable Args] Variables used for the test configuration. Multiple
config_variable
blocks are allowed with the structure below.- device_
ids Sequence[str] Array with the different device IDs used to run the test. Allowed enum values:
laptop_large
,tablet
,mobile_small
(only available forbrowser
tests).- message str
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.- options
Synthetics
Test Options Args - options_
list SyntheticsTest Options List Args - request_
basicauth SyntheticsTest Request Basicauth Args The HTTP basic authentication credentials. Exactly one nested block is allowed with the structure below.
- request_
client_ Syntheticscertificate Test Request Client Certificate Args Client certificate to use when performing the test request. Exactly one nested block is allowed with the structure below.
- request_
headers Mapping[str, Any] Header name and value map.
- request_
query Mapping[str, Any] Query arguments name and value map.
- steps
Sequence[Synthetics
Test Step Args] Steps for browser tests.
- subtype str
When
type
isapi
, choose fromhttp
,ssl
,tcp
ordns
. Defaults tohttp
.- Sequence[str]
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 (
[]
).- variables
Sequence[Synthetics
Test Variable Args] Variables used for a browser test steps. Multiple
browser_variable
blocks are allowed with the structure below.
Outputs
All input properties are implicitly available as output properties. Additionally, the SyntheticsTest resource produces the following output properties:
- id str
- The provider-assigned unique ID for this managed resource.
- monitor_
id int ID of the monitor associated with the Datadog synthetics test.
Look up an Existing SyntheticsTest Resource
Get an existing SyntheticsTest resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: SyntheticsTestState, opts?: CustomResourceOptions): SyntheticsTest
@staticmethod
def get(resource_name: str, id: str, opts: Optional[ResourceOptions] = None, assertions: Optional[Sequence[Mapping[str, Any]]] = None, browser_variables: Optional[Sequence[SyntheticsTestBrowserVariableArgs]] = None, config_variables: Optional[Sequence[SyntheticsTestConfigVariableArgs]] = None, device_ids: Optional[Sequence[str]] = None, locations: Optional[Sequence[str]] = None, message: Optional[str] = None, monitor_id: Optional[int] = None, name: Optional[str] = None, options: Optional[SyntheticsTestOptionsArgs] = None, options_list: Optional[SyntheticsTestOptionsListArgs] = None, request: Optional[SyntheticsTestRequestArgs] = None, request_basicauth: Optional[SyntheticsTestRequestBasicauthArgs] = None, request_client_certificate: Optional[SyntheticsTestRequestClientCertificateArgs] = None, request_headers: Optional[Mapping[str, Any]] = None, request_query: Optional[Mapping[str, Any]] = None, status: Optional[str] = None, steps: Optional[Sequence[SyntheticsTestStepArgs]] = None, subtype: Optional[str] = None, tags: Optional[Sequence[str]] = None, type: Optional[str] = None, variables: Optional[Sequence[SyntheticsTestVariableArgs]] = None) -> SyntheticsTest
func GetSyntheticsTest(ctx *Context, name string, id IDInput, state *SyntheticsTestState, opts ...ResourceOption) (*SyntheticsTest, error)
public static SyntheticsTest Get(string name, Input<string> id, SyntheticsTestState? state, CustomResourceOptions? opts = null)
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
The following state arguments are supported:
- Assertions
List<Immutable
Dictionary<string, object>> List of assertions.
- Browser
Variables List<SyntheticsTest Browser Variable Args> Variables used for a browser test steps. Multiple
variable
blocks are allowed with the structure below.- Config
Variables List<SyntheticsTest Config Variable Args> Variables used for the test configuration. Multiple
config_variable
blocks are allowed with the structure below.- Device
Ids List<string> Array with the different device IDs used to run the test. Allowed enum values:
laptop_large
,tablet
,mobile_small
(only available forbrowser
tests).- Locations List<string>
Array of locations used to run the test. Refer to Datadog documentation for available locations (e.g.
aws:eu-central-1
).- 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.- Monitor
Id int ID of the monitor associated with the Datadog synthetics test.
- Name string
Name of Datadog synthetics test.
- Options
Synthetics
Test Options Args - Options
List SyntheticsTest Options List Args - Request
Synthetics
Test Request Args The synthetics test request. Required if
type = "api"
andsubtype = "http"
.- Request
Basicauth SyntheticsTest Request Basicauth Args The HTTP basic authentication credentials. Exactly one nested block is allowed with the structure below.
- Request
Client SyntheticsCertificate Test Request Client Certificate Args Client certificate to use when performing the test request. Exactly one nested block is allowed with the structure below.
- Request
Headers Dictionary<string, object> Header name and value map.
- Request
Query Dictionary<string, object> Query arguments name and value map.
- Status string
Define whether you want to start (
live
) or pause (paused
) a Synthetic test. Allowed enum values:live
,paused
- Steps
List<Synthetics
Test Step Args> Steps for browser tests.
- Subtype string
When
type
isapi
, choose fromhttp
,ssl
,tcp
ordns
. Defaults tohttp
.- List<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 (
[]
).- Type string
Synthetics test type (
api
orbrowser
).- Variables
List<Synthetics
Test Variable Args> Variables used for a browser test steps. Multiple
browser_variable
blocks are allowed with the structure below.
- Assertions []map[string]interface{}
List of assertions.
- Browser
Variables []SyntheticsTest Browser Variable Variables used for a browser test steps. Multiple
variable
blocks are allowed with the structure below.- Config
Variables []SyntheticsTest Config Variable Variables used for the test configuration. Multiple
config_variable
blocks are allowed with the structure below.- Device
Ids []string Array with the different device IDs used to run the test. Allowed enum values:
laptop_large
,tablet
,mobile_small
(only available forbrowser
tests).- Locations []string
Array of locations used to run the test. Refer to Datadog documentation for available locations (e.g.
aws:eu-central-1
).- 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.- Monitor
Id int ID of the monitor associated with the Datadog synthetics test.
- Name string
Name of Datadog synthetics test.
- Options
Synthetics
Test Options - Options
List SyntheticsTest Options List - Request
Synthetics
Test Request The synthetics test request. Required if
type = "api"
andsubtype = "http"
.- Request
Basicauth SyntheticsTest Request Basicauth The HTTP basic authentication credentials. Exactly one nested block is allowed with the structure below.
- Request
Client SyntheticsCertificate Test Request Client Certificate Client certificate to use when performing the test request. Exactly one nested block is allowed with the structure below.
- Request
Headers map[string]interface{} Header name and value map.
- Request
Query map[string]interface{} Query arguments name and value map.
- Status string
Define whether you want to start (
live
) or pause (paused
) a Synthetic test. Allowed enum values:live
,paused
- Steps
[]Synthetics
Test Step Steps for browser tests.
- Subtype string
When
type
isapi
, choose fromhttp
,ssl
,tcp
ordns
. Defaults tohttp
.- []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 (
[]
).- Type string
Synthetics test type (
api
orbrowser
).- Variables
[]Synthetics
Test Variable Variables used for a browser test steps. Multiple
browser_variable
blocks are allowed with the structure below.
- assertions {[key: string]: any}[]
List of assertions.
- browser
Variables SyntheticsTest Browser Variable[] Variables used for a browser test steps. Multiple
variable
blocks are allowed with the structure below.- config
Variables SyntheticsTest Config Variable[] Variables used for the test configuration. Multiple
config_variable
blocks are allowed with the structure below.- device
Ids string[] Array with the different device IDs used to run the test. Allowed enum values:
laptop_large
,tablet
,mobile_small
(only available forbrowser
tests).- locations string[]
Array of locations used to run the test. Refer to Datadog documentation for available locations (e.g.
aws:eu-central-1
).- 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.- monitor
Id number ID of the monitor associated with the Datadog synthetics test.
- name string
Name of Datadog synthetics test.
- options
Synthetics
Test Options - options
List SyntheticsTest Options List - request
Synthetics
Test Request The synthetics test request. Required if
type = "api"
andsubtype = "http"
.- request
Basicauth SyntheticsTest Request Basicauth The HTTP basic authentication credentials. Exactly one nested block is allowed with the structure below.
- request
Client SyntheticsCertificate Test Request Client Certificate Client certificate to use when performing the test request. Exactly one nested block is allowed with the structure below.
- request
Headers {[key: string]: any} Header name and value map.
- request
Query {[key: string]: any} Query arguments name and value map.
- status string
Define whether you want to start (
live
) or pause (paused
) a Synthetic test. Allowed enum values:live
,paused
- steps
Synthetics
Test Step[] Steps for browser tests.
- subtype string
When
type
isapi
, choose fromhttp
,ssl
,tcp
ordns
. Defaults tohttp
.- 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 (
[]
).- type string
Synthetics test type (
api
orbrowser
).- variables
Synthetics
Test Variable[] Variables used for a browser test steps. Multiple
browser_variable
blocks are allowed with the structure below.
- assertions Sequence[Mapping[str, Any]]
List of assertions.
- browser_
variables Sequence[SyntheticsTest Browser Variable Args] Variables used for a browser test steps. Multiple
variable
blocks are allowed with the structure below.- config_
variables Sequence[SyntheticsTest Config Variable Args] Variables used for the test configuration. Multiple
config_variable
blocks are allowed with the structure below.- device_
ids Sequence[str] Array with the different device IDs used to run the test. Allowed enum values:
laptop_large
,tablet
,mobile_small
(only available forbrowser
tests).- locations Sequence[str]
Array of locations used to run the test. Refer to Datadog documentation for available locations (e.g.
aws:eu-central-1
).- message str
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.- monitor_
id int ID of the monitor associated with the Datadog synthetics test.
- name str
Name of Datadog synthetics test.
- options
Synthetics
Test Options Args - options_
list SyntheticsTest Options List Args - request
Synthetics
Test Request Args The synthetics test request. Required if
type = "api"
andsubtype = "http"
.- request_
basicauth SyntheticsTest Request Basicauth Args The HTTP basic authentication credentials. Exactly one nested block is allowed with the structure below.
- request_
client_ Syntheticscertificate Test Request Client Certificate Args Client certificate to use when performing the test request. Exactly one nested block is allowed with the structure below.
- request_
headers Mapping[str, Any] Header name and value map.
- request_
query Mapping[str, Any] Query arguments name and value map.
- status str
Define whether you want to start (
live
) or pause (paused
) a Synthetic test. Allowed enum values:live
,paused
- steps
Sequence[Synthetics
Test Step Args] Steps for browser tests.
- subtype str
When
type
isapi
, choose fromhttp
,ssl
,tcp
ordns
. Defaults tohttp
.- Sequence[str]
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 (
[]
).- type str
Synthetics test type (
api
orbrowser
).- variables
Sequence[Synthetics
Test Variable Args] Variables used for a browser test steps. Multiple
browser_variable
blocks are allowed with the structure below.
Supporting Types
SyntheticsTestBrowserVariable
SyntheticsTestConfigVariable
SyntheticsTestOptions
- Tick
Every int - Accept
Self boolSigned - Allow
Insecure bool - Follow
Redirects bool - Min
Failure intDuration - Min
Location intFailed - Retry
Count int - Retry
Interval int
- Tick
Every int - Accept
Self boolSigned - Allow
Insecure bool - Follow
Redirects bool - Min
Failure intDuration - Min
Location intFailed - Retry
Count int - Retry
Interval int
- tick
Every number - accept
Self booleanSigned - allow
Insecure boolean - follow
Redirects boolean - min
Failure numberDuration - min
Location numberFailed - retry
Count number - retry
Interval number
- tick_
every int - accept_
self_ boolsigned - allow_
insecure bool - follow_
redirects bool - min_
failure_ intduration - min_
location_ intfailed - retry_
count int - retry_
interval int
SyntheticsTestOptionsList
- accept
Self booleanSigned - allow
Insecure boolean - follow
Redirects boolean - min
Failure numberDuration - min
Location numberFailed - monitor
Options SyntheticsTest Options List Monitor Options - retry
Synthetics
Test Options List Retry - tick
Every number
SyntheticsTestOptionsListMonitorOptions
- Renotify
Interval int
- Renotify
Interval int
- renotify
Interval number
SyntheticsTestOptionsListRetry
SyntheticsTestRequest
SyntheticsTestRequestBasicauth
SyntheticsTestRequestClientCertificate
SyntheticsTestRequestClientCertificateCert
SyntheticsTestRequestClientCertificateKey
SyntheticsTestStep
- Name string
- Params string
- Type string
- Allow
Failure bool - Timeout int
- Name string
- Params string
- Type string
- Allow
Failure bool - Timeout int
- name string
- params string
- type string
- allow
Failure boolean - timeout number
- name str
- params str
- type str
- allow_
failure bool - timeout int
SyntheticsTestVariable
Import
Synthetics tests can be imported using their public string ID, e.g.
$ pulumi import datadog:index/syntheticsTest:SyntheticsTest fizz abc-123-xyz
Package Details
- Repository
- https://github.com/pulumi/pulumi-datadog
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
datadog
Terraform Provider.