Skip to main content

automation_rule_v2s

Creates, updates, deletes or gets an automation_rule_v2 resource or lists automation_rule_v2s in a region

Overview

Nameautomation_rule_v2s
TypeResource
DescriptionResource schema for AWS::SecurityHub::AutomationRuleV2
Idawscc.securityhub.automation_rule_v2s

Fields

NameDatatypeDescription
rule_namestringThe name of the automation rule
rule_statusstringThe status of the automation rule
descriptionstringA description of the automation rule
rule_ordernumberThe value for the rule priority
criteriaobjectDefines the parameters and conditions used to evaluate and filter security findings
actionsarrayA list of actions to be performed when the rule criteria is met
tagsobjectA key-value pair to associate with the Security Hub V2 resource. You can specify a key that is 1 to 128 Unicode characters in length and cannot be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, digits, whitespace, _, ., /, =, +, and -.
rule_arnstringThe ARN of the automation rule
rule_idstringThe ID of the automation rule
created_atstringThe date and time, in UTC and ISO 8601 format.
regionstringAWS region.

For more information, see AWS::SecurityHub::AutomationRuleV2.

Methods

NameResourceAccessible byRequired Params
create_resourceautomation_rule_v2sINSERTRuleName, Description, RuleOrder, Criteria, Actions, region
delete_resourceautomation_rule_v2sDELETEIdentifier, region
update_resourceautomation_rule_v2sUPDATEIdentifier, PatchDocument, region
list_resourcesautomation_rule_v2s_list_onlySELECTregion
get_resourceautomation_rule_v2sSELECTIdentifier, region

SELECT examples

Gets all properties from an individual automation_rule_v2.

SELECT
region,
rule_name,
rule_status,
description,
rule_order,
criteria,
actions,
tags,
rule_arn,
rule_id,
created_at,
updated_at
FROM awscc.securityhub.automation_rule_v2s
WHERE
region = 'us-east-1' AND
Identifier = '{{ rule_arn }}';

INSERT example

Use the following StackQL query and manifest file to create a new automation_rule_v2 resource, using stack-deploy.

/*+ create */
INSERT INTO awscc.securityhub.automation_rule_v2s (
RuleName,
Description,
RuleOrder,
Criteria,
Actions,
region
)
SELECT
'{{ rule_name }}',
'{{ description }}',
'{{ rule_order }}',
'{{ criteria }}',
'{{ actions }}',
'{{ region }}';

UPDATE example

Use the following StackQL query and manifest file to update a automation_rule_v2 resource, using stack-deploy.

/*+ update */
UPDATE awscc.securityhub.automation_rule_v2s
SET PatchDocument = string('{{ {
"RuleName": rule_name,
"RuleStatus": rule_status,
"Description": description,
"RuleOrder": rule_order,
"Criteria": criteria,
"Actions": actions,
"Tags": tags
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ rule_arn }}';

DELETE example

/*+ delete */
DELETE FROM awscc.securityhub.automation_rule_v2s
WHERE
Identifier = '{{ rule_arn }}' AND
region = 'us-east-1';

Permissions

To operate on the automation_rule_v2s resource, the following permissions are required:

securityhub:CreateAutomationRuleV2,
securityhub:GetAutomationRuleV2,
securityhub:TagResource,
securityhub:ListTagsForResource