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
Idawscc.inspectorv2.filters

Fields

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

For more information, see AWS::InspectorV2::Filter.

Methods

NameResourceAccessible byRequired Params
create_resourcefiltersINSERTName, FilterCriteria, FilterAction, region
delete_resourcefiltersDELETEIdentifier, region
update_resourcefiltersUPDATEIdentifier, PatchDocument, region
list_resourcesfilters_list_onlySELECTregion
get_resourcefiltersSELECTIdentifier, region

SELECT examples

Gets all properties from an individual filter.

SELECT
region,
name,
description,
filter_criteria,
filter_action,
arn,
tags
FROM awscc.inspectorv2.filters
WHERE
region = '{{ region }}' AND
Identifier = '{{ arn }}';

INSERT example

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

/*+ create */
INSERT INTO awscc.inspectorv2.filters (
Name,
FilterCriteria,
FilterAction,
region
)
SELECT
'{{ name }}',
'{{ filter_criteria }}',
'{{ filter_action }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

UPDATE example

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

/*+ update */
UPDATE awscc.inspectorv2.filters
SET PatchDocument = string('{{ {
"Name": name,
"Description": description,
"FilterCriteria": filter_criteria,
"FilterAction": filter_action,
"Tags": tags
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ arn }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

DELETE example

/*+ delete */
DELETE FROM awscc.inspectorv2.filters
WHERE
Identifier = '{{ arn }}' AND
region = '{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

Additional Parameters

Mutable resources in the Cloud Control provider support additional optional parameters which can be supplied with INSERT, UPDATE, or DELETE operations. These include:

ParameterDescription
ClientToken
A unique identifier to ensure the idempotency of the resource request.This allows the provider to accurately distinguish between retries and new requests.
A client token is valid for 36 hours once used.
After that, a resource request with the same client token is treated as a new request.
If you do not specify a client token, one is generated for inclusion in the request.
RoleArn
The ARN of the IAM role used to perform this resource operation.The role specified must have the permissions required for this operation.
If you do not specify a role, a temporary session is created using your AWS user credentials.
TypeVersionId
For private resource types, the type version to use in this resource operation.If you do not specify a resource version, the default version is used.

Permissions

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

inspector2:CreateFilter,
inspector2:ListFilters,
inspector2:TagResource