File tree 4 files changed +100
-0
lines changed
examples/resources/datadog_synthetics_test
4 files changed +100
-0
lines changed Original file line number Diff line number Diff line change 9
9
"github.com/google/uuid"
10
10
"github.com/hashicorp/terraform-plugin-testing/helper/resource"
11
11
"github.com/hashicorp/terraform-plugin-testing/terraform"
12
+
12
13
"github.com/terraform-providers/terraform-provider-datadog/datadog/fwprovider"
13
14
)
14
15
Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ import (
12
12
"github.com/google/uuid"
13
13
"github.com/hashicorp/terraform-plugin-testing/helper/resource"
14
14
"github.com/hashicorp/terraform-plugin-testing/terraform"
15
+
15
16
"github.com/terraform-providers/terraform-provider-datadog/datadog/fwprovider"
16
17
"github.com/terraform-providers/terraform-provider-datadog/datadog/internal/utils"
17
18
)
Original file line number Diff line number Diff line change @@ -208,6 +208,55 @@ resource "datadog_synthetics_test" "test_dns" {
208
208
}
209
209
}
210
210
211
+ # Example Usage (Synthetics ICMP test)
212
+ # Create a new Datadog Synthetics ICMP test on example.org
213
+ resource "datadog_synthetics_test" "test_api_icmp" {
214
+ name = "ICMP Test on example.com"
215
+ type = "api"
216
+ subtype = "icmp"
217
+ status = "live"
218
+ locations = ["aws:eu-central-1"]
219
+ tags = ["foo:bar", "foo", "env:test"]
220
+
221
+ request_definition {
222
+ host = "example.com"
223
+ no_saving_response_body = "false"
224
+ number_of_packets = "1"
225
+ persist_cookies = "false"
226
+ should_track_hops = "false"
227
+ timeout = "0"
228
+ }
229
+
230
+ assertion {
231
+ operator = "is"
232
+ target = "0"
233
+ type = "packetLossPercentage"
234
+ }
235
+
236
+ assertion {
237
+ operator = "lessThan"
238
+ property = "avg"
239
+ target = "1000"
240
+ type = "latency"
241
+ }
242
+
243
+ assertion {
244
+ operator = "moreThanOrEqual"
245
+ target = "1"
246
+ type = "packetsReceived"
247
+ }
248
+ options_list {
249
+ tick_every = 900
250
+ retry {
251
+ count = 2
252
+ interval = 300
253
+ }
254
+ monitor_options {
255
+ renotify_interval = 120
256
+ }
257
+ }
258
+ }
259
+
211
260
212
261
# Example Usage (Synthetics Multistep API test)
213
262
# Create a new Datadog Synthetics Multistep API test
Original file line number Diff line number Diff line change @@ -167,6 +167,55 @@ resource "datadog_synthetics_test" "test_dns" {
167
167
}
168
168
}
169
169
170
+ # Example Usage (Synthetics ICMP test)
171
+ # Create a new Datadog Synthetics ICMP test on example.org
172
+ resource "datadog_synthetics_test" "test_api_icmp" {
173
+ name = " ICMP Test on example.com"
174
+ type = " api"
175
+ subtype = " icmp"
176
+ status = " live"
177
+ locations = [" aws:eu-central-1" ]
178
+ tags = [" foo:bar" , " foo" , " env:test" ]
179
+
180
+ request_definition {
181
+ host = " example.com"
182
+ no_saving_response_body = " false"
183
+ number_of_packets = " 1"
184
+ persist_cookies = " false"
185
+ should_track_hops = " false"
186
+ timeout = " 0"
187
+ }
188
+
189
+ assertion {
190
+ operator = " is"
191
+ target = " 0"
192
+ type = " packetLossPercentage"
193
+ }
194
+
195
+ assertion {
196
+ operator = " lessThan"
197
+ property = " avg"
198
+ target = " 1000"
199
+ type = " latency"
200
+ }
201
+
202
+ assertion {
203
+ operator = " moreThanOrEqual"
204
+ target = " 1"
205
+ type = " packetsReceived"
206
+ }
207
+ options_list {
208
+ tick_every = 900
209
+ retry {
210
+ count = 2
211
+ interval = 300
212
+ }
213
+ monitor_options {
214
+ renotify_interval = 120
215
+ }
216
+ }
217
+ }
218
+
170
219
171
220
# Example Usage (Synthetics Multistep API test)
172
221
# Create a new Datadog Synthetics Multistep API test
You can’t perform that action at this time.
0 commit comments