Skip to main content

filters

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

Overview​

Namefilters
TypeResource
Idaws.inspector2.filters

Fields​

The following fields are returned by SELECT queries:

NameDatatypeDescription
namestringThe name of the filter.
actionstringThe action that is to be applied to the findings that match the filter. (NONE, SUPPRESS)
arnstringThe Amazon Resource Number (ARN) associated with this filter.
created_atstring (date-time)The date and time this filter was created at.
criteriaobjectDetails on the criteria used to define the filter.
descriptionstringA description of the filter.
owner_idstringThe Amazon Web Services account ID of the account that created the filter. (pattern: <code>.(^\d{12}$)|(^o-[a-z0-9]{10,32}$).</code>)
reasonstringThe reason for the filter.
tagsobjectThe tags attached to the filter.
updated_atstring (date-time)The date and time the filter was last updated at.

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
list_filtersselectregionLists the filters associated with your account.
create_filterinsertregion, action, filterCriteria, nameCreates a filter resource using specified filter criteria. When the filter action is set to SUPPRESS this action creates a suppression rule.
update_filterupdateregion, filterArnSpecifies the action that is to be applied to the findings that match the filter.
delete_filterdeleteregionDeletes a filter resource.

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)

SELECT examples​

Lists the filters associated with your account.

SELECT
name,
action,
arn,
created_at,
criteria,
description,
owner_id,
reason,
tags,
updated_at
FROM aws.inspector2.filters
WHERE region = '{{ region }}' -- required
;

INSERT examples​

Creates a filter resource using specified filter criteria. When the filter action is set to SUPPRESS this action creates a suppression rule.

INSERT INTO aws.inspector2.filters (
action,
description,
filterCriteria,
name,
tags,
reason,
region
)
SELECT
'{{ action }}' /* required */,
'{{ description }}',
'{{ filterCriteria }}' /* required */,
'{{ name }}' /* required */,
'{{ tags }}',
'{{ reason }}',
'{{ region }}'
RETURNING
arn
;

UPDATE examples​

Specifies the action that is to be applied to the findings that match the filter.

UPDATE aws.inspector2.filters
SET
action = '{{ action }}',
description = '{{ description }}',
filterCriteria = '{{ filterCriteria }}',
name = '{{ name }}',
filterArn = '{{ filterArn }}',
reason = '{{ reason }}'
WHERE
region = '{{ region }}' --required
AND filterArn = '{{ filterArn }}' --required
RETURNING
arn;

DELETE examples​

Deletes a filter resource.

DELETE FROM aws.inspector2.filters
WHERE region = '{{ region }}' --required
;