Adding a tag to a data store - AWS HealthLake

Adding a tag to a data store

Adding tags to a data store can help you identify and organize your AWS resources and manage access to them. First, you add one or more tags (key-value pairs) to a Data Store. You can use up to fifty tags per user. There are also restrictions on the characters you can use in the key and value fields.

After you have tags, you can create IAM policies to manage access to the data store based on these tags. You can use the the HealthLake console or the AWS CLI to add tags to a data store. Adding tags to a repository can impact access to that repository. Before you add a tag to a data store, make sure to review any IAM policies that might use tags to control access to resources such as data stores.

Follow these steps to use the AWS CLI to add a tag to a HealthLake data store. To add a tag to a data store when you create it, see Creating a HealthLake data store.

At the terminal or command line, run the tag-resource command, specifying the Amazon Resource Name (ARN) of the data store where you want to add tags and the key and value of the tag you want to add. You can add more than one tag to a data store. There are also restrictions on the characters you can use in the key and value fields, as listed in Tagging requirementsFor example, to add tags to a data store while it is being created, you would use the following command in the AWS CLI. The name of the data store is Test_Data_Store, and the two added tags with keys are key1 and key2 with values as value1 and value2 respectively
:

aws healthlake create-fhir-datastore --datastore-type-version R4 --preload-data-config PreloadDataType="SYNTHEA" --datastore-name "Test_Data_Store" --tags '[{"Key": "key1", "Value": "value1"}, {"Key": "key2", "Value": "value2"}]' --region us-east-1

To add tags to an existing data store, you would run the following example command:

aws healthlake tag-resource --resource-arn "arn:aws:healthlake:us-east-1:691207106566:datastore/fhir/0725c83f4307f263e16fd56b6d8ebdbe" --tags '[{"Key": "key1", "Value": "value1"}]' --region us-east-1

If successful, this command returns no response.