Skip to content

create_findings_filter async

create_findings_filter(
    *,
    config_overrides: Optional[AsyncMacie2ClientConfig] = None,
    action: Optional[FindingsFilterAction] = None,
    client_token: Optional[__string] = None,
    description: Optional[__string] = None,
    finding_criteria: Optional[FindingCriteria] = None,
    name: Optional[__string] = None,
    position: Optional[__integer] = None,
    tags: Optional[TagMap] = None,
) -> CreateFindingsFilterResponse

Creates and defines the criteria and other settings for a findings filter.

Parameters:

  • action (Optional[FindingsFilterAction], default: None ) –

    The action to perform on findings that match the filter criteria (findingCriteria). Valid values are: ARCHIVE, suppress (automatically archive) the findings; and, NOOP, don't perform any action on the findings.

  • client_token (Optional[__string], default: None ) –

    A unique, case-sensitive token that you provide to ensure the idempotency of the request.

  • description (Optional[__string], default: None ) –

    A custom description of the filter. The description can contain as many as 512 characters.

    We strongly recommend that you avoid including any sensitive data in the description of a filter. Other users of your account might be able to see this description, depending on the actions that they're allowed to perform in Amazon Macie.

  • finding_criteria (Optional[FindingCriteria], default: None ) –

    The criteria to use to filter findings.

  • name (Optional[__string], default: None ) –

    A custom name for the filter. The name must contain at least 3 characters and can contain as many as 64 characters.

    We strongly recommend that you avoid including any sensitive data in the name of a filter. Other users of your account might be able to see this name, depending on the actions that they're allowed to perform in Amazon Macie.

  • position (Optional[__integer], default: None ) –

    The position of the filter in the list of saved filters on the Amazon Macie console. This value also determines the order in which the filter is applied to findings, relative to other filters that are also applied to the findings.

  • tags (Optional[TagMap], default: None ) –

    A map of key-value pairs that specifies the tags to associate with the filter.

    A findings filter can have a maximum of 50 tags. Each tag consists of a tag key and an associated tag value. The maximum length of a tag key is 128 characters. The maximum length of a tag value is 256 characters.

Raises:

  • AccessDeniedException –

    Provides information about an error that occurred due to insufficient access to a specified resource.

  • ConflictException –

    Provides information about an error that occurred due to a versioning conflict for a specified resource.

  • InternalServerException –

    Provides information about an error that occurred due to an unknown internal server error, exception, or failure.

  • ResourceNotFoundException –

    Provides information about an error that occurred because a specified resource wasn't found.

  • ServiceQuotaExceededException –

    Provides information about an error that occurred due to one or more service quotas for an account.

  • ThrottlingException –

    Provides information about an error that occurred because too many requests were sent during a certain amount of time.

  • ValidationException –

    Provides information about an error that occurred due to a syntax error in a request.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_macie2/_services/async_macie2.py
async def create_findings_filter(
    self,
    *,
    config_overrides: Optional[AsyncMacie2ClientConfig] = None,
    action: Optional[
        "capo_macie2.types.findings_filter_action.FindingsFilterAction"
    ] = None,
    client_token: Optional["capo_macie2.types.__string.__string"] = None,
    description: Optional["capo_macie2.types.__string.__string"] = None,
    finding_criteria: Optional[
        "capo_macie2.types.finding_criteria.FindingCriteria"
    ] = None,
    name: Optional["capo_macie2.types.__string.__string"] = None,
    position: Optional["capo_macie2.types.__integer.__integer"] = None,
    tags: Optional["capo_macie2.types.tag_map.TagMap"] = None,
) -> (
    "capo_macie2.types.create_findings_filter_response.CreateFindingsFilterResponse"
):
    """<p>Creates and defines the criteria and other settings for a findings filter.</p>

    Args:
        action: <p>The action to perform on findings that match the filter criteria (findingCriteria). Valid values are: ARCHIVE, suppress (automatically archive) the findings; and, NOOP, don't perform any action on the findings.</p>
        client_token: <p>A unique, case-sensitive token that you provide to ensure the idempotency of the request.</p>
        description: <p>A custom description of the filter. The description can contain as many as 512 characters.</p> <p>We strongly recommend that you avoid including any sensitive data in the description of a filter. Other users of your account might be able to see this description, depending on the actions that they're allowed to perform in Amazon Macie.</p>
        finding_criteria: <p>The criteria to use to filter findings.</p>
        name: <p>A custom name for the filter. The name must contain at least 3 characters and can contain as many as 64 characters.</p> <p>We strongly recommend that you avoid including any sensitive data in the name of a filter. Other users of your account might be able to see this name, depending on the actions that they're allowed to perform in Amazon Macie.</p>
        position: <p>The position of the filter in the list of saved filters on the Amazon Macie console. This value also determines the order in which the filter is applied to findings, relative to other filters that are also applied to the findings.</p>
        tags: <p>A map of key-value pairs that specifies the tags to associate with the filter.</p> <p>A findings filter can have a maximum of 50 tags. Each tag consists of a tag key and an associated tag value. The maximum length of a tag key is 128 characters. The maximum length of a tag value is 256 characters.</p>

    Raises:
        capo_macie2.errors.access_denied_exception.AccessDeniedException: <p>Provides information about an error that occurred due to insufficient access to a specified resource.</p>
        capo_macie2.errors.conflict_exception.ConflictException: <p>Provides information about an error that occurred due to a versioning conflict for a specified resource.</p>
        capo_macie2.errors.internal_server_exception.InternalServerException: <p>Provides information about an error that occurred due to an unknown internal server error, exception, or failure.</p>
        capo_macie2.errors.resource_not_found_exception.ResourceNotFoundException: <p>Provides information about an error that occurred because a specified resource wasn't found.</p>
        capo_macie2.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>Provides information about an error that occurred due to one or more service quotas for an account.</p>
        capo_macie2.errors.throttling_exception.ThrottlingException: <p>Provides information about an error that occurred because too many requests were sent during a certain amount of time.</p>
        capo_macie2.errors.validation_exception.ValidationException: <p>Provides information about an error that occurred due to a syntax error in a request.</p>
        capo_macie2.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_macie2.types.create_findings_filter_request.CreateFindingsFilterRequest]",
    ) -> AsyncOperationResponse[
        "capo_macie2.types.create_findings_filter_response.CreateFindingsFilterResponse"
    ]:
        import capo_macie2._operations.macie2.create_findings_filter

        (
            output,
            http_response,
        ) = await capo_macie2._operations.macie2.create_findings_filter.async_create_findings_filter(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateFindingsFilter")
    )
    input_: capo_macie2.types.create_findings_filter_request.CreateFindingsFilterRequest = {}
    if action is not None:
        input_["action"] = action
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token
    if description is not None:
        input_["description"] = description
    if finding_criteria is not None:
        input_["finding_criteria"] = finding_criteria
    if name is not None:
        input_["name"] = name
    if position is not None:
        input_["position"] = position
    if tags is not None:
        input_["tags"] = tags

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output