Skip to content

delete_topic async

delete_topic(
    topic_arn: topicARN, *, config_overrides: Optional[AsyncSNSClientConfig] = None
) -> None

Deletes a topic and all its subscriptions. Deleting a topic might prevent some messages previously sent to the topic from being delivered to subscribers. This action is idempotent, so deleting a topic that does not exist does not result in an error.

Parameters:

  • topic_arn (topicARN) –

    The ARN of the topic you want to delete.

Raises:

Source code in docs_src/capo_sns/_services/async_sns.py
async def delete_topic(
    self,
    topic_arn: "capo_sns.types.topic_arn.topicARN",
    *,
    config_overrides: Optional[AsyncSNSClientConfig] = None,
) -> None:
    """<p>Deletes a topic and all its subscriptions. Deleting a topic might prevent some messages previously sent to the topic from being delivered to subscribers. This action is idempotent, so deleting a topic that does not exist does not result in an error.</p>

    Args:
        topic_arn: <p>The ARN of the topic you want to delete.</p>

    Raises:
        capo_sns.errors.authorization_error_exception.AuthorizationErrorException: <p>Indicates that the user has been denied access to the requested resource.</p>
        capo_sns.errors.concurrent_access_exception.ConcurrentAccessException: <p>Can't perform multiple operations on a tag simultaneously. Perform the operations sequentially.</p>
        capo_sns.errors.internal_error_exception.InternalErrorException: <p>Indicates an internal service error.</p>
        capo_sns.errors.invalid_parameter_exception.InvalidParameterException: <p>Indicates that a request parameter does not comply with the associated constraints.</p>
        capo_sns.errors.invalid_state_exception.InvalidStateException: <p>Indicates that the specified state is not a valid state for an event source.</p>
        capo_sns.errors.not_found_exception.NotFoundException: <p>Indicates that the requested resource does not exist.</p>
        capo_sns.errors.stale_tag_exception.StaleTagException: <p>A tag has been added to a resource with the same ARN as a deleted resource. Wait a short while and then retry the operation.</p>
        capo_sns.errors.tag_policy_exception.TagPolicyException: <p>The request doesn't comply with the IAM tag policy. Correct your request and then retry it.</p>
        capo_sns.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_sns.types.delete_topic_input.DeleteTopicInput]",
    ) -> AsyncOperationResponse[None]:
        import capo_sns._operations.amazon_simple_notification_service.delete_topic

        (
            output,
            http_response,
        ) = await capo_sns._operations.amazon_simple_notification_service.delete_topic.async_delete_topic(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DeleteTopic")
    )
    input_: capo_sns.types.delete_topic_input.DeleteTopicInput = {
        "topic_arn": topic_arn
    }

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output