Deleting a data store example - AWS HealthLake

Deleting a data store example

To delete a HealthLake data store you can use the AWS Management Console, AWS Management Console, AWS SDKs, and the AWS CLI.

Deleting a data store is an asynchronous operation. Once started, the status changes to Deleting. A data store maintains the status of Deleting until all the FHIR data from the date store, and underlying infrastructure necessary are removed as well.

Once the data and infrastructure are removed, your HealthLake data store status changes to Deleted. After deletion, the details about your data stores are available only by using the DescribeFHIRDataStore and ListFHIRDataStores operations for seven days. After seven days, the deleted data store will not appear in the results.

To successfully delete a data store the user, group, or role making the request must have the IAM action glue:DeleteDatabase added to their IAM policy. This IAM action is not included as part of the AWS managed policy, AmazonHealthLakeFullAccess.

To delete a HealthLake data store (AWS Management Console)
  1. Open the HealthLake console at https://console.aws.amazon.com//healthlake/home.

  2. Open the Navigation pane (≡).

  3. Then, choose Data Stores.

  4. On the Data Stores page, choose the option next to the data store you want to delete.

  5. Then, choose Delete

  6. In the dialog box type delete to confirm that you want to delete the select data store.

  7. Then, choose Delete.

Then the status of your data store will change from Active to Deleting.

To delete a HealthLake data store (AWS CLI and SDKs)

You can use the code samples below to delete a HealthLake data store.

AWS CLI

The following examples demonstrates using the DeleteFHIRDatastore operation with the AWS CLI. To run the example, you must install the AWS CLI.

aws healthlake delete-fhir-datastore --datastore-id 'eeb8005725ae22b35b4edbdc68cf2dfd'

When successful, you get the following JSON response.

{ "DatastoreProperties": { "DatastoreId": "eeb8005725ae22b35b4edbdc68cf2dfd", "DatastoreArn": "arn:aws:healthlake:us-west-2:728347309221:datastore/fhir/", "DatastoreName": "delete-me", "DatastoreStatus": "ACTIVE", "CreatedAt": "2022-10-03T10:53:45.020000-07:00", "DatastoreTypeVersion": "R4", "DatastoreEndpoint": "https://healthlake.us-west-2.amazonaws.com/datastore/5b6e4cd798289a4ab8dad6c1002dd731/r4/", "SseConfiguration": { "KmsEncryptionConfig": { "CmkType": "AWS_OWNED_KMS_KEY" } }, "PreloadDataConfig": { "PreloadDataType": "SYNTHEA" } } }
Python (boto3)

The AWS SDK for Python supports the describe_fhir_datastore method which takes in a single parameter DatastoreId.

import boto3 #Create a Healthlake client healthlake_client = boto3.client('healthlake') #Call the describe_fhir_datastore method data_store_details = healthlake_client.describe_fhir_datastore(DatastoreId='cdf8f1557e57c543bdc627fb8f12b7fd') print(data_store_details)

When successful, it returns a python dictionary.

{'DatastoreProperties': {'DatastoreId': 'cdf8f1557e57c543bdc627fb8f12b7fd', 'DatastoreArn': 'arn:aws:healthlake:us-west-2:728347309221:datastore/fhir/cdf8f1557e57c543bdc627fb8f12b7fd', 'DatastoreName': '08-24-2022-test-data-store', 'DatastoreStatus': 'ACTIVE', 'CreatedAt': datetime.datetime(2022, 8, 23, 22, 12, 14, 359000, tzinfo=tzlocal()), 'DatastoreTypeVersion': 'R4', 'DatastoreEndpoint': 'https://healthlake.us-west-2.amazonaws.com/datastore/cdf8f1557e57c543bdc627fb8f12b7fd/r4/', 'SseConfiguration': {'KmsEncryptionConfig': {'CmkType': 'AWS_OWNED_KMS_KEY'}}, 'PreloadDataConfig': {'PreloadDataType': 'SYNTHEA'}}, 'ResponseMetadata': {'RequestId': 'aef4b268-ad4b-4b57-bc97-2da956356835', 'HTTPStatusCode': 200, 'HTTPHeaders': {'date': 'Wed, 05 Oct 2022 01:21:44 GMT', 'content-type': 'application/x-amz-json-1.0', 'content-length': '547', 'connection': 'keep-alive', 'x-amzn-requestid': 'aef4b268-ad4b-4b57-bc97-2da956356835'}, 'RetryAttempts': 0}}

To return details about more than one data store at a time use ListFHIRDatastore

use the DeleteFHIRDataStore command using the AWS CLI as shown in the following example. You can also delete a data store using the delete-fhir-datastore API or the console. Deleting a data store removes all of the FHIR resource versions contained within the data store and the underlying infrastructure. Logs related to a deleted data store are retained within the service account in accordance with HIPAA guidelines.

aws healthlake delete-fhir-datastore --datastore-id (Data Store ID)

As shown in the following example JSON response, the status changes to "DELETING" to confirm that the data store and its contents are in the process of being deleted.

{ "DatastoreEndpoint": "https://healthlake.us-east-1.amazonaws.com/datastore/eeb8005725ae22b35b4edbdc68cf2dfd/r4/", "DatastoreArn": "arn:aws:healthlake:us-east-1:(AWS Account ID):datastore/(Datastore ID)", "DatastoreStatus": "DELETING", "DatastoreId": "(Datastore ID)" }