Deletes a Firehose stream and its data.
You can delete a Firehose stream only if it is in one of the following states: ACTIVE, DELETING, CREATING_FAILED, or DELETING_FAILED. You can't delete a Firehose stream that is in the CREATING state. To check the state of a Firehose stream, use DescribeDeliveryStream.
DeleteDeliveryStream is an asynchronous API. When an API request to DeleteDeliveryStream succeeds, the Firehose stream is marked for deletion, and it goes into the DELETING state.While the Firehose stream is in the DELETING state, the service might continue to accept records, but it doesn't make any guarantees with respect to delivering the data. Therefore, as a best practice, first stop any applications that are sending records before you delete a Firehose stream.
Removal of a Firehose stream that is in the DELETING state is a low priority operation for the service. A stream may remain in the DELETING state for several minutes. Therefore, as a best practice, applications should not wait for streams in the DELETING state to be removed.
Parameters:
-
delivery_stream_name
(DeliveryStreamName)
–
The name of the Firehose stream.
-
allow_force_delete
(Optional[BooleanObject], default:
None
)
–
Set this to true if you want to delete the Firehose stream even if Firehose is unable to retire the grant for the CMK. Firehose might be unable to retire the grant due to a customer error, such as when the CMK or the grant are in an invalid state. If you force deletion, you can then use the RevokeGrant operation to revoke the grant you gave to Firehose. If a failure to retire the grant happens due to an Amazon Web Services KMS issue, Firehose keeps retrying the delete operation.
The default value is false.
Raises:
Source code in docs_src/capo_firehose/_services/firehose.py
| def delete_delivery_stream(
self,
delivery_stream_name: "capo_firehose.types.delivery_stream_name.DeliveryStreamName",
*,
config_overrides: Optional[FirehoseClientConfig] = None,
allow_force_delete: Optional[
"capo_firehose.types.boolean_object.BooleanObject"
] = None,
) -> "capo_firehose.types.delete_delivery_stream_output.DeleteDeliveryStreamOutput":
"""<p>Deletes a Firehose stream and its data.</p> <p>You can delete a Firehose stream only if it is in one of the following states: <code>ACTIVE</code>, <code>DELETING</code>, <code>CREATING_FAILED</code>, or <code>DELETING_FAILED</code>. You can't delete a Firehose stream that is in the <code>CREATING</code> state. To check the state of a Firehose stream, use <a>DescribeDeliveryStream</a>. </p> <p>DeleteDeliveryStream is an asynchronous API. When an API request to DeleteDeliveryStream succeeds, the Firehose stream is marked for deletion, and it goes into the <code>DELETING</code> state.While the Firehose stream is in the <code>DELETING</code> state, the service might continue to accept records, but it doesn't make any guarantees with respect to delivering the data. Therefore, as a best practice, first stop any applications that are sending records before you delete a Firehose stream.</p> <p>Removal of a Firehose stream that is in the <code>DELETING</code> state is a low priority operation for the service. A stream may remain in the <code>DELETING</code> state for several minutes. Therefore, as a best practice, applications should not wait for streams in the <code>DELETING</code> state to be removed. </p>
Args:
delivery_stream_name: <p>The name of the Firehose stream.</p>
allow_force_delete: <p>Set this to true if you want to delete the Firehose stream even if Firehose is unable to retire the grant for the CMK. Firehose might be unable to retire the grant due to a customer error, such as when the CMK or the grant are in an invalid state. If you force deletion, you can then use the <a href="https://docs.aws.amazon.com/kms/latest/APIReference/API_RevokeGrant.html">RevokeGrant</a> operation to revoke the grant you gave to Firehose. If a failure to retire the grant happens due to an Amazon Web Services KMS issue, Firehose keeps retrying the delete operation.</p> <p>The default value is false.</p>
Raises:
capo_firehose.errors.resource_in_use_exception.ResourceInUseException: <p>The resource is already in use and not available for this operation.</p>
capo_firehose.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource could not be found.</p>
capo_firehose.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_firehose.types.delete_delivery_stream_input.DeleteDeliveryStreamInput]",
) -> OperationResponse[
"capo_firehose.types.delete_delivery_stream_output.DeleteDeliveryStreamOutput"
]:
import capo_firehose._operations.firehose_20150804.delete_delivery_stream
output, http_response = (
capo_firehose._operations.firehose_20150804.delete_delivery_stream.delete_delivery_stream(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("DeleteDeliveryStream")
)
input_: capo_firehose.types.delete_delivery_stream_input.DeleteDeliveryStreamInput = {
"delivery_stream_name": delivery_stream_name
}
if allow_force_delete is not None:
input_["allow_force_delete"] = allow_force_delete
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|