Skip to main content

waf_custom_rules

Creates, updates, deletes, gets or lists a waf_custom_rules resource.

Overview

Namewaf_custom_rules
TypeResource
Iddatadog.remote_config.waf_custom_rules

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringThe ID of the custom rule. (example: 2857c47d-1e3a-4300-8b2f-dc24089c084b)
attributesobjectA WAF custom rule.
typestringThe type of the resource. The value should always be custom_rule. (default: custom_rule, example: custom_rule)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_application_security_waf_custom_ruleselectcustom_rule_id, regionRetrieve a WAF custom rule by ID.
list_application_security_wafcustom_rulesselectregionRetrieve a list of WAF custom rule.
create_application_security_waf_custom_ruleinsertregion, data__dataCreate a new WAF custom rule with the given parameters.
update_application_security_waf_custom_rulereplacecustom_rule_id, region, data__dataUpdate a specific WAF custom Rule.
Returns the Custom Rule object when the request is successful.
delete_application_security_waf_custom_ruledeletecustom_rule_id, regionDelete a specific WAF custom rule.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
custom_rule_idstringThe ID of the custom rule. (example: 3b5-v82-ns6)
regionstring(default: datadoghq.com)

SELECT examples

Retrieve a WAF custom rule by ID.

SELECT
id,
attributes,
type
FROM datadog.remote_config.waf_custom_rules
WHERE custom_rule_id = '{{ custom_rule_id }}' -- required
AND region = '{{ region }}' -- required
;

INSERT examples

Create a new WAF custom rule with the given parameters.

INSERT INTO datadog.remote_config.waf_custom_rules (
data__data,
region
)
SELECT
'{{ data }}' /* required */,
'{{ region }}'
RETURNING
data
;

REPLACE examples

Update a specific WAF custom Rule.
Returns the Custom Rule object when the request is successful.

REPLACE datadog.remote_config.waf_custom_rules
SET
data__data = '{{ data }}'
WHERE
custom_rule_id = '{{ custom_rule_id }}' --required
AND region = '{{ region }}' --required
AND data__data = '{{ data }}' --required
RETURNING
data;

DELETE examples

Delete a specific WAF custom rule.

DELETE FROM datadog.remote_config.waf_custom_rules
WHERE custom_rule_id = '{{ custom_rule_id }}' --required
AND region = '{{ region }}' --required
;