Skip to main content

filters

Creates, updates, deletes or gets a filter resource or lists filters in a region

Overview

Namefilters
TypeResource
DescriptionInspector Filter resource schema
Idaws.inspectorv2.filters

Fields

NameDatatypeDescription
namestringFindings filter name.
descriptionstringFindings filter description.
filter_criteriaobjectFindings filter criteria.
filter_actionstringFindings filter action.
arnstringFindings filter ARN.
regionstringAWS region.

Methods

NameAccessible byRequired Params
create_resourceINSERTName, FilterCriteria, FilterAction, region
delete_resourceDELETEdata__Identifier, region
update_resourceUPDATEdata__Identifier, data__PatchDocument, region
list_resourcesSELECTregion
get_resourceSELECTdata__Identifier, region

SELECT examples

Gets all filters in a region.

SELECT
region,
name,
description,
filter_criteria,
filter_action,
arn
FROM aws.inspectorv2.filters
WHERE region = 'us-east-1';

Gets all properties from an individual filter.

SELECT
region,
name,
description,
filter_criteria,
filter_action,
arn
FROM aws.inspectorv2.filters
WHERE region = 'us-east-1' AND data__Identifier = '<Arn>';

INSERT example

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

/*+ create */
INSERT INTO aws.inspectorv2.filters (
Name,
FilterCriteria,
FilterAction,
region
)
SELECT
'{{ Name }}',
'{{ FilterCriteria }}',
'{{ FilterAction }}',
'{{ region }}';

DELETE example

/*+ delete */
DELETE FROM aws.inspectorv2.filters
WHERE data__Identifier = '<Arn>'
AND region = 'us-east-1';

Permissions

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

Create

inspector2:CreateFilter,
inspector2:ListFilters

Read

inspector2:ListFilters

Update

inspector2:ListFilters,
inspector2:UpdateFilter

Delete

inspector2:DeleteFilter,
inspector2:ListFilters

List

inspector2:ListFilters