Skip to content

create_audit_suppression

create_audit_suppression(
    check_name: AuditCheckName,
    resource_identifier: ResourceIdentifier,
    client_request_token: ClientRequestToken,
    *,
    config_overrides: Optional[IoTClientConfig] = None,
    expiration_date: Optional[Timestamp] = None,
    suppress_indefinitely: Optional[SuppressIndefinitely] = None,
    description: Optional[AuditDescription] = None,
) -> CreateAuditSuppressionResponse

Creates a Device Defender audit suppression.

Requires permission to access the CreateAuditSuppression action.

Parameters:

  • expiration_date (Optional[Timestamp], default: None ) –

    The epoch timestamp in seconds at which this suppression expires.

  • suppress_indefinitely (Optional[SuppressIndefinitely], default: None ) –

    Indicates whether a suppression should exist indefinitely or not.

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

    The description of the audit suppression.

  • client_request_token (ClientRequestToken) –

    Each audit supression must have a unique client request token. If you try to create a new audit suppression with the same token as one that already exists, an exception occurs. If you omit this value, Amazon Web Services SDKs will automatically generate a unique client request.

Raises:

Source code in docs_src/capo_iot/_services/io_t.py
def create_audit_suppression(
    self,
    check_name: "capo_iot.types.audit_check_name.AuditCheckName",
    resource_identifier: "capo_iot.types.resource_identifier.ResourceIdentifier",
    client_request_token: "capo_iot.types.client_request_token.ClientRequestToken",
    *,
    config_overrides: Optional[IoTClientConfig] = None,
    expiration_date: Optional["capo_iot.types.timestamp.Timestamp"] = None,
    suppress_indefinitely: Optional[
        "capo_iot.types.suppress_indefinitely.SuppressIndefinitely"
    ] = None,
    description: Optional[
        "capo_iot.types.audit_description.AuditDescription"
    ] = None,
) -> "capo_iot.types.create_audit_suppression_response.CreateAuditSuppressionResponse":
    """<p> Creates a Device Defender audit suppression. </p> <p>Requires permission to access the <a href="https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsiot.html#awsiot-actions-as-permissions">CreateAuditSuppression</a> action.</p>

    Args:
        expiration_date: <p> The epoch timestamp in seconds at which this suppression expires. </p>
        suppress_indefinitely: <p> Indicates whether a suppression should exist indefinitely or not. </p>
        description: <p> The description of the audit suppression. </p>
        client_request_token: <p> Each audit supression must have a unique client request token. If you try to create a new audit suppression with the same token as one that already exists, an exception occurs. If you omit this value, Amazon Web Services SDKs will automatically generate a unique client request.</p>

    Raises:
        capo_iot.errors.internal_failure_exception.InternalFailureException: <p>An unexpected error has occurred.</p>
        capo_iot.errors.invalid_request_exception.InvalidRequestException: <p>The request is not valid.</p>
        capo_iot.errors.limit_exceeded_exception.LimitExceededException: <p>A limit has been exceeded.</p>
        capo_iot.errors.resource_already_exists_exception.ResourceAlreadyExistsException: <p>The resource already exists.</p>
        capo_iot.errors.throttling_exception.ThrottlingException: <p>The rate exceeds the limit.</p>
        capo_iot.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_iot.types.create_audit_suppression_request.CreateAuditSuppressionRequest]",
    ) -> OperationResponse[
        "capo_iot.types.create_audit_suppression_response.CreateAuditSuppressionResponse"
    ]:
        import capo_iot._operations.aws_iot_service.create_audit_suppression

        output, http_response = (
            capo_iot._operations.aws_iot_service.create_audit_suppression.create_audit_suppression(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateAuditSuppression")
    )
    input_: capo_iot.types.create_audit_suppression_request.CreateAuditSuppressionRequest = {
        "check_name": check_name,
        "resource_identifier": resource_identifier,
        "client_request_token": client_request_token,
    }
    if expiration_date is not None:
        input_["expiration_date"] = expiration_date
    if suppress_indefinitely is not None:
        input_["suppress_indefinitely"] = suppress_indefinitely
    if description is not None:
        input_["description"] = description

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