Skip to content

create_custom_data_identifier async

create_custom_data_identifier(
    *,
    config_overrides: Optional[AsyncMacie2ClientConfig] = None,
    client_token: Optional[__string] = None,
    description: Optional[__string] = None,
    ignore_words: Optional[__listOf__string] = None,
    keywords: Optional[__listOf__string] = None,
    maximum_match_distance: Optional[__integer] = None,
    name: Optional[__string] = None,
    regex: Optional[__string] = None,
    severity_levels: Optional[SeverityLevelList] = None,
    tags: Optional[TagMap] = None,
) -> CreateCustomDataIdentifierResponse

Creates and defines the criteria and other settings for a custom data identifier.

Parameters:

  • 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 custom data identifier. The description can contain as many as 512 characters.

    We strongly recommend that you avoid including any sensitive data in the description of a custom data identifier. 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.

  • ignore_words (Optional[__listOf__string], default: None ) –

    An array that lists specific character sequences (ignore words) to exclude from the results. If the text matched by the regular expression contains any string in this array, Amazon Macie ignores it. The array can contain as many as 10 ignore words. Each ignore word can contain 4-90 UTF-8 characters. Ignore words are case sensitive.

  • keywords (Optional[__listOf__string], default: None ) –

    An array that lists specific character sequences (keywords), one of which must precede and be within proximity (maximumMatchDistance) of the regular expression to match. The array can contain as many as 50 keywords. Each keyword can contain 3-90 UTF-8 characters. Keywords aren't case sensitive.

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

    The maximum number of characters that can exist between the end of at least one complete character sequence specified by the keywords array and the end of the text that matches the regex pattern. If a complete keyword precedes all the text that matches the pattern and the keyword is within the specified distance, Amazon Macie includes the result. The distance can be 1-300 characters. The default value is 50.

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

    A custom name for the custom data identifier. The name can contain as many as 128 characters.

    We strongly recommend that you avoid including any sensitive data in the name of a custom data identifier. 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.

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

    The regular expression (regex) that defines the pattern to match. The expression can contain as many as 512 characters.

  • severity_levels (Optional[SeverityLevelList], default: None ) –

    The severity to assign to findings that the custom data identifier produces, based on the number of occurrences of text that match the custom data identifier's detection criteria. You can specify as many as three SeverityLevel objects in this array, one for each severity: LOW, MEDIUM, or HIGH. If you specify more than one, the occurrences thresholds must be in ascending order by severity, moving from LOW to HIGH. For example, 1 for LOW, 50 for MEDIUM, and 100 for HIGH. If an S3 object contains fewer occurrences than the lowest specified threshold, Amazon Macie doesn't create a finding.

    If you don't specify any values for this array, Macie creates findings for S3 objects that contain at least one occurrence of text that matches the detection criteria, and Macie assigns the MEDIUM severity to those findings.

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

    A map of key-value pairs that specifies the tags to associate with the custom data identifier.

    A custom data identifier 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_custom_data_identifier(
    self,
    *,
    config_overrides: Optional[AsyncMacie2ClientConfig] = None,
    client_token: Optional["capo_macie2.types.__string.__string"] = None,
    description: Optional["capo_macie2.types.__string.__string"] = None,
    ignore_words: Optional[
        "capo_macie2.types.__list_of__string.__listOf__string"
    ] = None,
    keywords: Optional[
        "capo_macie2.types.__list_of__string.__listOf__string"
    ] = None,
    maximum_match_distance: Optional[
        "capo_macie2.types.__integer.__integer"
    ] = None,
    name: Optional["capo_macie2.types.__string.__string"] = None,
    regex: Optional["capo_macie2.types.__string.__string"] = None,
    severity_levels: Optional[
        "capo_macie2.types.severity_level_list.SeverityLevelList"
    ] = None,
    tags: Optional["capo_macie2.types.tag_map.TagMap"] = None,
) -> "capo_macie2.types.create_custom_data_identifier_response.CreateCustomDataIdentifierResponse":
    """<p>Creates and defines the criteria and other settings for a custom data identifier.</p>

    Args:
        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 custom data identifier. 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 custom data identifier. 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>
        ignore_words: <p>An array that lists specific character sequences (<i>ignore words</i>) to exclude from the results. If the text matched by the regular expression contains any string in this array, Amazon Macie ignores it. The array can contain as many as 10 ignore words. Each ignore word can contain 4-90 UTF-8 characters. Ignore words are case sensitive.</p>
        keywords: <p>An array that lists specific character sequences (<i>keywords</i>), one of which must precede and be within proximity (maximumMatchDistance) of the regular expression to match. The array can contain as many as 50 keywords. Each keyword can contain 3-90 UTF-8 characters. Keywords aren't case sensitive.</p>
        maximum_match_distance: <p>The maximum number of characters that can exist between the end of at least one complete character sequence specified by the keywords array and the end of the text that matches the regex pattern. If a complete keyword precedes all the text that matches the pattern and the keyword is within the specified distance, Amazon Macie includes the result. The distance can be 1-300 characters. The default value is 50.</p>
        name: <p>A custom name for the custom data identifier. The name can contain as many as 128 characters.</p> <p>We strongly recommend that you avoid including any sensitive data in the name of a custom data identifier. 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>
        regex: <p>The regular expression (<i>regex</i>) that defines the pattern to match. The expression can contain as many as 512 characters.</p>
        severity_levels: <p>The severity to assign to findings that the custom data identifier produces, based on the number of occurrences of text that match the custom data identifier's detection criteria. You can specify as many as three SeverityLevel objects in this array, one for each severity: LOW, MEDIUM, or HIGH. If you specify more than one, the occurrences thresholds must be in ascending order by severity, moving from LOW to HIGH. For example, 1 for LOW, 50 for MEDIUM, and 100 for HIGH. If an S3 object contains fewer occurrences than the lowest specified threshold, Amazon Macie doesn't create a finding.</p> <p>If you don't specify any values for this array, Macie creates findings for S3 objects that contain at least one occurrence of text that matches the detection criteria, and Macie assigns the MEDIUM severity to those findings.</p>
        tags: <p>A map of key-value pairs that specifies the tags to associate with the custom data identifier.</p> <p>A custom data identifier 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_custom_data_identifier_request.CreateCustomDataIdentifierRequest]",
    ) -> AsyncOperationResponse[
        "capo_macie2.types.create_custom_data_identifier_response.CreateCustomDataIdentifierResponse"
    ]:
        import capo_macie2._operations.macie2.create_custom_data_identifier

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateCustomDataIdentifier")
    )
    input_: capo_macie2.types.create_custom_data_identifier_request.CreateCustomDataIdentifierRequest = {}
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token
    if description is not None:
        input_["description"] = description
    if ignore_words is not None:
        input_["ignore_words"] = ignore_words
    if keywords is not None:
        input_["keywords"] = keywords
    if maximum_match_distance is not None:
        input_["maximum_match_distance"] = maximum_match_distance
    if name is not None:
        input_["name"] = name
    if regex is not None:
        input_["regex"] = regex
    if severity_levels is not None:
        input_["severity_levels"] = severity_levels
    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