Skip to content

Commit 1c32d2e

Browse files
committed
add blockedRequestPatterns
Signed-off-by: Katia SHANG <[email protected]>
1 parent 2cd579c commit 1c32d2e

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

datadog/resource_datadog_synthetics_test_.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -867,6 +867,14 @@ func syntheticsTestOptionsList() *schema.Schema {
867867
Type: schema.TypeInt,
868868
Optional: true,
869869
},
870+
"blocked_request_patterns": {
871+
Description: "URL patterns to block for browser tests.",
872+
Type: schema.TypeList,
873+
Optional: true,
874+
Elem: &schema.Schema{
875+
Type: schema.TypeString,
876+
},
877+
},
870878
"http_version": syntheticsHttpVersionOption(),
871879
},
872880
},
@@ -4330,6 +4338,10 @@ func buildDatadogTestOptions(d *schema.ResourceData) *datadogV1.SyntheticsTestOp
43304338
options.SetInitialNavigationTimeout(int64(initialNavigationTimeout.(int)))
43314339
}
43324340

4341+
if blockedRequestPatterns, ok := d.GetOk("options_list.0.blocked_request_patterns"); ok {
4342+
options.SetBlockedRequestPatterns(blockedRequestPatterns.([]string))
4343+
}
4344+
43334345
if attr, ok := d.GetOk("device_ids"); ok {
43344346
var deviceIds []string
43354347
for _, s := range attr.([]interface{}) {
@@ -4473,6 +4485,9 @@ func buildTerraformTestOptions(actualOptions datadogV1.SyntheticsTestOptions) []
44734485
if actualOptions.HasInitialNavigationTimeout() {
44744486
localOptionsList["initial_navigation_timeout"] = actualOptions.GetInitialNavigationTimeout()
44754487
}
4488+
if actualOptions.HasBlockedRequestPatterns() {
4489+
localOptionsList["blockedRequestPatterns"] = actualOptions.GetBlockedRequestPatterns()
4490+
}
44764491

44774492
localOptionsLists := make([]map[string]interface{}, 1)
44784493
localOptionsLists[0] = localOptionsList

docs/resources/synthetics_test.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1441,6 +1441,7 @@ Optional:
14411441

14421442
- `accept_self_signed` (Boolean) For SSL tests, whether or not the test should allow self signed certificates.
14431443
- `allow_insecure` (Boolean) Allows loading insecure content for a request in an API test or in a multistep API test step.
1444+
- `blocked_request_patterns` (String List) Array of URL patterns to block for browser tests.
14441445
- `check_certificate_revocation` (Boolean) For SSL tests, whether or not the test should fail on revoked certificate in stapled OCSP.
14451446
- `ci` (Block List, Max: 1) CI/CD options for a Synthetic test. (see [below for nested schema](#nestedblock--options_list--ci))
14461447
- `disable_aia_intermediate_fetching` (Boolean) For SSL tests, whether or not the test should disable fetching intermediate certificates from AIA

0 commit comments

Comments
 (0)