Skip to main content

automation_rules

Creates, updates, deletes, gets or lists an automation_rules resource.

Overview

Nameautomation_rules
TypeResource
Idaws.securityhub.automation_rules

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
rulesarrayA list of rule details for the provided rule ARNs.
unprocessed_automation_rulesarrayA list of objects containing RuleArn, ErrorCode, and ErrorMessage. This parameter tells you which automation rules the request didn't retrieve and why.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
batch_get_automation_rulesselectregionRetrieves a list of details for automation rules based on rule Amazon Resource Names (ARNs).
list_automation_rulesselectregionNextToken, MaxResultsA list of automation rules and their metadata for the calling account.
create_automation_ruleinsertregion, RuleOrder, RuleName, Description, Criteria, ActionsCreates an automation rule based on input parameters.
batch_delete_automation_rulesexecregion, AutomationRulesArnsDeletes one or more automation rules.
batch_update_automation_rulesexecregion, UpdateAutomationRulesRequestItemsUpdates one or more automation rules based on rule Amazon Resource Names (ARNs) and input parameters.

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
regionstringAWS region (default: us-east-1)
MaxResultsintegerThe maximum number of rules to return in the response. This currently ranges from 1 to 100.
NextTokenstringA token to specify where to start paginating the response. This is the NextToken from a previously truncated response. On your first call to the ListAutomationRules API, set the value of this parameter to NULL.

SELECT examples

Retrieves a list of details for automation rules based on rule Amazon Resource Names (ARNs).

SELECT
rules,
unprocessed_automation_rules
FROM aws.securityhub.automation_rules
WHERE region = '{{ region }}' -- required
;

INSERT examples

Creates an automation rule based on input parameters.

INSERT INTO aws.securityhub.automation_rules (
Tags,
RuleStatus,
RuleOrder,
RuleName,
Description,
IsTerminal,
Criteria,
Actions,
region
)
SELECT
'{{ Tags }}',
'{{ RuleStatus }}',
{{ RuleOrder }} /* required */,
'{{ RuleName }}' /* required */,
'{{ Description }}' /* required */,
{{ IsTerminal }},
'{{ Criteria }}' /* required */,
'{{ Actions }}' /* required */,
'{{ region }}'
RETURNING
rule_arn
;

Lifecycle Methods

Deletes one or more automation rules.

EXEC aws.securityhub.automation_rules.batch_delete_automation_rules
@region='{{ region }}' --required
@@json=
'{
"AutomationRulesArns": "{{ AutomationRulesArns }}"
}'
;