Skip to content

create_allow_list

create_allow_list(
    *,
    config_overrides: Optional[Macie2ClientConfig] = None,
    client_token: Optional[__string] = None,
    criteria: Optional[AllowListCriteria] = None,
    description: Optional[__stringMin1Max512PatternSS] = None,
    name: Optional[__stringMin1Max128Pattern] = None,
    tags: Optional[TagMap] = None,
) -> CreateAllowListResponse

Creates and defines the settings for an allow list.

Parameters:

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

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

  • criteria (Optional[AllowListCriteria], default: None ) –

    The criteria that specify the text or text pattern to ignore. The criteria can be the location and name of an S3 object that lists specific text to ignore (s3WordsList), or a regular expression (regex) that defines a text pattern to ignore.

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

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

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

    A custom name for the allow list. The name can contain as many as 128 characters.

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

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

    An allow list 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/macie2.py
def create_allow_list(
    self,
    *,
    config_overrides: Optional[Macie2ClientConfig] = None,
    client_token: Optional["capo_macie2.types.__string.__string"] = None,
    criteria: Optional[
        "capo_macie2.types.allow_list_criteria.AllowListCriteria"
    ] = None,
    description: Optional[
        "capo_macie2.types.__string_min1_max512_pattern_ss.__stringMin1Max512PatternSS"
    ] = None,
    name: Optional[
        "capo_macie2.types.__string_min1_max128_pattern.__stringMin1Max128Pattern"
    ] = None,
    tags: Optional["capo_macie2.types.tag_map.TagMap"] = None,
) -> "capo_macie2.types.create_allow_list_response.CreateAllowListResponse":
    """<p>Creates and defines the settings for an allow list.</p>

    Args:
        client_token: <p>A unique, case-sensitive token that you provide to ensure the idempotency of the request.</p>
        criteria: <p>The criteria that specify the text or text pattern to ignore. The criteria can be the location and name of an S3 object that lists specific text to ignore (s3WordsList), or a regular expression (regex) that defines a text pattern to ignore.</p>
        description: <p>A custom description of the allow list. The description can contain as many as 512 characters.</p>
        name: <p>A custom name for the allow list. The name can contain as many as 128 characters.</p>
        tags: <p>A map of key-value pairs that specifies the tags to associate with the allow list.</p> <p>An allow list 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.
    """

    def _handler(
        req: "OperationRequest[capo_macie2.types.create_allow_list_request.CreateAllowListRequest]",
    ) -> OperationResponse[
        "capo_macie2.types.create_allow_list_response.CreateAllowListResponse"
    ]:
        import capo_macie2._operations.macie2.create_allow_list

        output, http_response = (
            capo_macie2._operations.macie2.create_allow_list.create_allow_list(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateAllowList")
    )
    input_: capo_macie2.types.create_allow_list_request.CreateAllowListRequest = {}
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token
    if criteria is not None:
        input_["criteria"] = criteria
    if description is not None:
        input_["description"] = description
    if name is not None:
        input_["name"] = name
    if tags is not None:
        input_["tags"] = tags

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output