Skip to content

Commit

Permalink
Fix kinesis stream delete
Browse files Browse the repository at this point in the history
Deletes are asynchronous
  • Loading branch information
simonrw authored and sannya-singal committed May 9, 2024
1 parent 8e7af35 commit 49aad81
Showing 1 changed file with 18 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -138,14 +138,24 @@ def delete(
- kinesis:DeleteStream
- kinesis:RemoveTagsFromStream
"""
model = request.desired_state
request.aws_client_factory.kinesis.delete_stream(
StreamARN=model["Arn"], EnforceConsumerDeletion=True
)
return ProgressEvent(
status=OperationStatus.SUCCESS,
resource_model={},
)
model = request.previous_state
client = request.aws_client_factory.kinesis

if not request.custom_context.get(REPEATED_INVOCATION):
client.delete_stream(StreamARN=model["Arn"], EnforceConsumerDeletion=True)
request.custom_context[REPEATED_INVOCATION] = True

try:
client.describe_stream(StreamARN=model["Arn"])
return ProgressEvent(
status=OperationStatus.IN_PROGRESS,
resource_model={},
)
except client.exceptions.ResourceNotFoundException:
return ProgressEvent(
status=OperationStatus.SUCCESS,
resource_model={},
)

def update(
self,
Expand Down

0 comments on commit 49aad81

Please sign in to comment.