FSx / Client / delete_file_cache



Deletes an Amazon File Cache resource. After deletion, the cache no longer exists, and its data is gone.

The DeleteFileCache operation returns while the cache has the DELETING status. You can check the cache deletion status by calling the DescribeFileCaches operation, which returns a list of caches in your account. If you pass the cache ID for a deleted cache, the DescribeFileCaches operation returns a FileCacheNotFound error.


The data in a deleted cache is also deleted and can’t be recovered by any means.

See also: AWS API Documentation

Request Syntax

response = client.delete_file_cache(
  • FileCacheId (string) –


    The ID of the cache that’s being deleted.

  • ClientRequestToken (string) –

    (Optional) An idempotency token for resource creation, in a string of up to 63 ASCII characters. This token is automatically filled on your behalf when you use the Command Line Interface (CLI) or an Amazon Web Services SDK.

    This field is autopopulated if not provided.

Return type:



Response Syntax

    'FileCacheId': 'string',

Response Structure

  • (dict) –

    • FileCacheId (string) –

      The ID of the cache that’s being deleted.

    • Lifecycle (string) –

      The cache lifecycle for the deletion request. If the DeleteFileCache operation is successful, this status is DELETING.


  • FSx.Client.exceptions.BadRequest

  • FSx.Client.exceptions.IncompatibleParameterError

  • FSx.Client.exceptions.FileCacheNotFound

  • FSx.Client.exceptions.ServiceLimitExceeded

  • FSx.Client.exceptions.InternalServerError